2015-07-05 22:28:31 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# hrunorraise --- Raise a window or start a new process
|
|
|
|
#
|
|
|
|
# Tries to find a window ID for a window with a given class value. If
|
|
|
|
# no such window can be found treat the rest of the command line as
|
|
|
|
# the command to start.
|
|
|
|
#
|
|
|
|
# This script depends on both herbstluftwm and wmctrl.
|
|
|
|
|
2015-07-05 22:29:19 +02:00
|
|
|
WINID=$(wmctrl -lx | grep "\.$1" | awk '{ print $1 }')
|
2015-07-05 22:28:31 +02:00
|
|
|
|
|
|
|
if [ -n "${WINID}" ]; then
|
|
|
|
herbstclient jumpto "${WINID}"
|
|
|
|
else
|
|
|
|
shift
|
|
|
|
exec "$@"
|
|
|
|
fi
|