Skip to content

Instantly share code, notes, and snippets.

@finalclass
Created July 26, 2016 08:30
Show Gist options
  • Save finalclass/767f322f5931283afdae8513cfefcad2 to your computer and use it in GitHub Desktop.
Save finalclass/767f322f5931283afdae8513cfefcad2 to your computer and use it in GitHub Desktop.
#!/bin/bash
appCommand=$1
appName=$2
if [[ `wmctrl -l | grep "$appName"` ]]; then
wmctrl -a "$appName"
else
echo "running $appCommand"
$appCommand
wmctrl -a "$appName"
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment