Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Get Windows like App Hotkey Start-up behavior. First Argument: Path to app. Second argument: App-class (wmctrl -lx)
#!/bin/bash
contains() {
[[ $1 =~ $2 ]] && return 0 || return 1
}
app_list=$(wmctrl -lx | awk '{print $3}')
if contains "$app_list" "$2";
then wmctrl -x -a "$2" ;
else ("$1"&) ;
fi
Owner

AKuederle commented Jul 21, 2016

There is a updated version, with the additional functionality of minimizing the window available here: https://gist.github.com/olegtc/d4b9858e9257ef7a0811ea8b109dd0c2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment