aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.config/herbstluftwm/switcher.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/.config/herbstluftwm/switcher.sh b/.config/herbstluftwm/switcher.sh
index e7ed342..5bd020d 100755
--- a/.config/herbstluftwm/switcher.sh
+++ b/.config/herbstluftwm/switcher.sh
@@ -2,13 +2,13 @@
source ~/.config/herbstluftwm/config_vars
-IFS=$'\r\n' clients=($(wmctrl -l | cut -c -10))
-number=$(wmctrl -l | cut -c 20- | nl -w 2 -s ") " | \
+list=$(wmctrl -l)
+IFS=$'\r\n' nums=($(echo $list | cut -d ' ' -f 1))
+choice=$(echo $list | cut -d ' ' -f 5- | nl -w 2 -s ") " | \
dmenu -fn $efont -i -h $bheight -nb $bg_normal -nf $fg_normal \
-sb $bg_focus -sf $fg_focus -p "Select:" -l 40 | \
- grep -oE '[0-9]' | head -1)
+ cut -d ')' -f 1)
-echo ${clients[$number]}
-if [ $number ]; then
- herbstclient jumpto ${clients[$number]}
+if [ $choice ]; then
+ herbstclient jumpto ${nums[$choice]}
fi