aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/instance-select-wmii.sh
diff options
context:
space:
mode:
authorGravatar Luca Bruno <lucab@debian.org>2010-05-16 15:11:12 +0200
committerGravatar Luca Bruno <lucab@debian.org>2010-05-16 15:11:12 +0200
commit3f33558e48612004b70d0b726f7e5651b6f67ea1 (patch)
treeae70067e2d7c4c2de8ea7b956460a18c197d8cae /examples/data/scripts/instance-select-wmii.sh
parent6a06bd6706092ccf300fda02726c2066b03721c8 (diff)
Avoid bash specific syntax in helpers
Most of our helpers don't really depend on bash, and work just fine with every system shell. Thus, let's avoid "bashisms" in there to accomodate more bare-bone shells (like dash, see https://wiki.ubuntu.com/DashAsBinSh ) Signed-off-by: Luca Bruno <lucab@debian.org>
Diffstat (limited to 'examples/data/scripts/instance-select-wmii.sh')
-rwxr-xr-xexamples/data/scripts/instance-select-wmii.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/data/scripts/instance-select-wmii.sh b/examples/data/scripts/instance-select-wmii.sh
index fdd27e6..64b859e 100755
--- a/examples/data/scripts/instance-select-wmii.sh
+++ b/examples/data/scripts/instance-select-wmii.sh
@@ -20,7 +20,7 @@ else
DMENU="dmenu -i"
fi
-if [ "$1" == 'list' ]
+if [ "$1" = 'list' ]
then
list=
# get window id's of uzbl clients. we could also get the label in one shot but it's pretty tricky
@@ -29,9 +29,9 @@ then
label=$(wmiir read /client/$i/label)
list="$list$i : $label\n"
done
- window=$(echo -e "$list" | $DMENU $COLORS | cut -d ' ' -f1)
+ window=$(printf "$list\n" | $DMENU $COLORS | cut -d ' ' -f1)
wmiir xwrite /tag/sel/ctl "select client $window"
-elif [ "$1" == 'next' ]
+elif [ "$1" = 'next' ]
then
current=$(wmiir read /client/sel/ctl | head -n 1)
# find the next uzbl window and focus it
@@ -40,7 +40,7 @@ then
then
wmiir xwrite /tag/sel/ctl "select client $next"
fi
-elif [ "$1" == 'prev' ]
+elif [ "$1" = 'prev' ]
then
current=$(wmiir read /client/sel/ctl | head -n 1)
prev=$(wmiir read /tag/sel/index | grep -B 10000 " $current " | tac | grep -m 1 uzbl | cut -d ' ' -f2)