Skip to content

Instantly share code, notes, and snippets.

@popstas
Last active December 20, 2015 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save popstas/9e1641e39abbda6392f1 to your computer and use it in GitHub Desktop.
Save popstas/9e1641e39abbda6392f1 to your computer and use it in GitHub Desktop.
#!/bin/bash
# http://blog.popstas.ru/blog/2015/11/16/show-all-terminal-windows-in-ubuntu/
# Activate all windows with process name of currently active window
# Получить текущее активное окно, его pid, имя процесса
current_pid=$(xdotool getwindowpid $(xdotool getactivewindow))
current_name=$(ps -p $current_pid -o comm=)
clean_name=${current_name%-}
name=${1:-$clean_name}
# найти окна процесса (только видимые), активировать каждое из них
xdotool search --onlyvisible --class "$name" \
| xargs -L1 --no-run-if-empty xdotool windowactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment