summaryrefslogtreecommitdiffstats
path: root/herbstluftwm
diff options
context:
space:
mode:
authorGravatar Tom Willemse2015-07-05 22:28:31 +0200
committerGravatar Tom Willemse2015-07-05 22:28:31 +0200
commitd8a6c9640c204395354cb0dc37ac09fd5981deb6 (patch)
treef15660a62d64607a1e5d4bc78d3f1f7e68d41302 /herbstluftwm
parent40d9a1b3fef4b833c12051a3c6a5e1f76ed5771c (diff)
downloaddotfiles-d8a6c9640c204395354cb0dc37ac09fd5981deb6.tar.gz
dotfiles-d8a6c9640c204395354cb0dc37ac09fd5981deb6.zip
Add hrunorraise script for herbstluftwm
Diffstat (limited to 'herbstluftwm')
-rwxr-xr-xherbstluftwm/usr/bin/hrunorraise17
1 files changed, 17 insertions, 0 deletions
diff --git a/herbstluftwm/usr/bin/hrunorraise b/herbstluftwm/usr/bin/hrunorraise
new file mode 100755
index 0000000..f869e93
--- /dev/null
+++ b/herbstluftwm/usr/bin/hrunorraise
@@ -0,0 +1,17 @@
+#!/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.
+
+WINID=$(wmctrl -lx | grep ".$1" | awk '{ print $1 }')
+
+if [ -n "${WINID}" ]; then
+ herbstclient jumpto "${WINID}"
+else
+ shift
+ exec "$@"
+fi