diff options
author | Thorsten Wißmann <edu@thorsten-wissmann.de> | 2011-10-24 00:39:56 +0200 |
---|---|---|
committer | Thorsten Wißmann <edu@thorsten-wissmann.de> | 2011-10-24 00:39:56 +0200 |
commit | 30bfd531e1c7fdfbf1dc65392fad21c796c04133 (patch) | |
tree | 36e092a84b2e6d156f457ceeab70105edae5013a /scripts | |
parent | 2e0fa5f2527f5d312aa01ca554eb74042df15730 (diff) |
scripts: added exec_on_tag.sh
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/exec_on_tag.sh | 26 |
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 "$@" + |