summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorThorsten Wißmann <edu@thorsten-wissmann.de>2011-10-24 00:39:56 +0200
committerThorsten Wißmann <edu@thorsten-wissmann.de>2011-10-24 00:39:56 +0200
commit30bfd531e1c7fdfbf1dc65392fad21c796c04133 (patch)
tree36e092a84b2e6d156f457ceeab70105edae5013a /scripts
parent2e0fa5f2527f5d312aa01ca554eb74042df15730 (diff)
scripts: added exec_on_tag.sh
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/exec_on_tag.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/exec_on_tag.sh b/scripts/exec_on_tag.sh
new file mode 100755
index 00000000..6fcac162
--- /dev/null
+++ b/scripts/exec_on_tag.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+
+TAG="$1"
+EXPIRE="120" # expiry time in seconds
+shift
+
+if [ -z "$TAG" ] || [ -z "$1" ] ;then
+ echo "usage: $0 TAG COMMAND [ARGS ...]" >&2
+ echo "executes a COMMAND on a specific TAG" >&2
+ echo "if TAG doesnot exist, it will be created" >&2
+
+fi
+
+function hc() {
+ herbstclient "$@"
+}
+
+# ensure tag exists
+hc add "$TAG"
+
+# move next window from this process to this tag
+hc rule maxage="$EXPIRE" pid="$$" tag="$TAG" once
+
+exec "$@"
+