From 721668ea57fda4254ceee9146c6b6bee470b3fc6 Mon Sep 17 00:00:00 2001 From: Tslil Clingman Date: Sun, 28 May 2017 17:32:03 -0500 Subject: Ran shellcheck, fixed (?) things --- ratws | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ratws') diff --git a/ratws b/ratws index af49cd3..6dc09ce 100755 --- a/ratws +++ b/ratws @@ -1,8 +1,10 @@ #!/usr/bin/env sh w=$(ratpoison -c windows) -#[ "$1" == "-s" ] && p="Tab" && w=$(echo "$w" | grep '(surf)') -#[ "$1" == "-w" ] && p="Windows" && w=$(echo "$w" | grep -v '(surf)') -[ -z $w ] && exit +[ "$1" = "-s" ] && p="Tab" && w=$(echo "$w" | grep '(surf)') +[ "$1" = "-w" ] && p="Windows" && w=$(echo "$w" | grep -v '(surf)') +[ -z "$w" ] && exit sel=$(echo "$w" | ratdm -p ${p:-All}' >' | cut -d ' ' -f 1) -[ -n $sel ] && ratpoison -c "select $sel" || true +if [ -n "$sel" ]; then + ratpoison -c "select $sel" +fi; -- cgit v1.2.3