From b9cc0b3e0a9ed7f5ce1181e94cf813544011547e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 21 Aug 2010 10:07:26 -0400 Subject: Put `then' on the same line as `if' --- examples/data/scripts/instance-select-wmii.sh | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'examples/data/scripts/instance-select-wmii.sh') diff --git a/examples/data/scripts/instance-select-wmii.sh b/examples/data/scripts/instance-select-wmii.sh index fdd27e6..1340351 100755 --- a/examples/data/scripts/instance-select-wmii.sh +++ b/examples/data/scripts/instance-select-wmii.sh @@ -13,39 +13,32 @@ COLORS=" -nb #303030 -nf khaki -sb #CCFFAA -sf #303030" -if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]' -then +if dmenu --help 2>&1 | grep -q '\[-rs\] \[-ni\] \[-nl\] \[-xs\]'; then DMENU="dmenu -i -xs -rs -l 10" # vertical patch else DMENU="dmenu -i" fi -if [ "$1" == 'list' ] -then +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 - for i in $(wmiir read /tag/sel/index | grep uzbl |cut -d ' ' -f2) - do + for i in $(wmiir read /tag/sel/index | grep uzbl |cut -d ' ' -f2); do label=$(wmiir read /client/$i/label) list="$list$i : $label\n" done window=$(echo -e "$list" | $DMENU $COLORS | cut -d ' ' -f1) wmiir xwrite /tag/sel/ctl "select client $window" -elif [ "$1" == 'next' ] -then +elif [ "$1" == 'next' ]; then current=$(wmiir read /client/sel/ctl | head -n 1) # find the next uzbl window and focus it next=$(wmiir read /tag/sel/index | grep -A 10000 " $current " | grep -m 1 uzbl | cut -d ' ' -f2) - if [ x"$next" != "x" ] - then + if [ x"$next" != "x" ]; then wmiir xwrite /tag/sel/ctl "select client $next" fi -elif [ "$1" == 'prev' ] -then +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) - if [ x"$prev" != "x" ] - then + if [ x"$prev" != "x" ]; then wmiir xwrite /tag/sel/ctl "select client $prev" fi else -- cgit v1.2.3