Last active
April 17, 2016 03:49
-
-
Save iberianpig/38a7dfe61b5dc59de7f855330b7c6ab4 to your computer and use it in GitHub Desktop.
switch terminal and browser
This file contains hidden or 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 | |
browser_title="Google Chrome" | |
terminal_title="byobu" | |
current_window_id=$(xdotool getwindowfocus) | |
browser_window_id=$(xdotool search --name --onlyvisible "$browser_title") | |
terminal_window_id=$(xdotool search --name --onlyvisible "$terminal_title") | |
if test $current_window_id -eq $browser_window_id | |
then | |
xdotool windowactivate $terminal_window_id | |
else | |
xdotool windowactivate $browser_window_id | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment