Skip to content

Instantly share code, notes, and snippets.

@zoni
Created July 28, 2012 16:24
Show Gist options
  • Select an option

  • Save zoni/3193908 to your computer and use it in GitHub Desktop.

Select an option

Save zoni/3193908 to your computer and use it in GitHub Desktop.
Run application or switch to it if already active
#!/bin/sh
if [ -z "$2" ]
then
wmctrl -x -a "$1" || exec $1 &
else
wmctrl -x -a "$1" || exec $2 &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment