Last active
December 20, 2015 21:50
-
-
Save popstas/9e1641e39abbda6392f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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