Skip to content

Instantly share code, notes, and snippets.

@bugventure
Last active August 29, 2015 14:07
Show Gist options
  • Save bugventure/e61ff1928b208727ce28 to your computer and use it in GitHub Desktop.
Save bugventure/e61ff1928b208727ce28 to your computer and use it in GitHub Desktop.
Bash script to start a new or focus any open terminal window in Ubuntu
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