aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm
diff options
context:
space:
mode:
Diffstat (limited to '.config/herbstluftwm')
-rwxr-xr-x.config/herbstluftwm/switcher.sh23
1 files changed, 11 insertions, 12 deletions
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]