Created
October 17, 2016 21:32
-
-
Save kurobeats/15661d18d0c64a0b9d3cc282ec4d9f06 to your computer and use it in GitHub Desktop.
Single instance gnome terminal script
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
| #!/usr/bin/env bash | |
| # You'll want xdotool, but other than that, you would be good to go. | |
| # Just download and set keyboard shortcut | |
| if [ "$(xdotool search --onlyvisible --class gnome-terminal)" == "$(xdotool getwindowfocus)" ]; then | |
| xdotool windowminimize $(xdotool getwindowfocus) | |
| exit | |
| fi | |
| if ps aux | grep "[g]nome-terminal" > /dev/null | |
| then xdotool windowactivate $(xdotool search --onlyvisible --class gnome-terminal) | |
| else | |
| gnome-terminal & | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment