From d2c4188780e9037a894c1df0d62ad76ce67bb245 Mon Sep 17 00:00:00 2001 From: katherine Date: Wed, 20 Mar 2024 14:29:50 -0700 Subject: drop wmctrl from switcher ought to have done long while ago --- .config/herbstluftwm/switcher.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to '.config') diff --git a/.config/herbstluftwm/switcher.sh b/.config/herbstluftwm/switcher.sh index 2558303..7199e1c 100755 --- a/.config/herbstluftwm/switcher.sh +++ b/.config/herbstluftwm/switcher.sh @@ -5,17 +5,16 @@ source ~/.config/init/vars typeset -i choice nums=() lines="" -while read -rA line; do - nums=( "${nums[@]}" "${line[1]}" ) - if [[ -z "$lines" ]]; then - lines="${line[@]:3}" - else - lines="${lines}\n${line[@]:3}" - fi -done < <(wmctrl -l) -echo -e "$lines" | nl -w 2 -s ") " | dmenu -fn "${bfont}:size=${bfont_size}" -i -h "$bheight" \ - -nb "$bar_bg" -nf "$bar_fg" -sb "$bg_focus" -sf "$fg_focus" \ - -p "Select:" -l 40 | cut -d ')' -f 1 | read choice +hc foreach --unique T tags.by-name echo T | cut -d '.' -f 3- | while read t; do + hc list_clients --title --tag=$t +done | while read -rA l; do + nums+=( $l[1] ) + [[ -z $lines ]] && lines=${l[@]:1} || lines="${lines}\n${l[@]:1}" +done -herbstclient jumpto "${nums[$choice]}" +echo -e $lines | nl -w 2 -s ") " | dmenu -fn "${bfont}:size=${bfont_size}" -i \ + -h $bheight -nb $bar_bg -nf $bar_fg -sb $bg_focus -sf $fg_focus \ + -p "Select:" -l 40 | cut -d ')' -f 1 | read choice + +hc jumpto $nums[$choice] -- cgit v1.2.3