aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm/switcher.sh
blob: 7199e1cae01d3b33cd8c03980ee8977bc8c0cadb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env zsh

source ~/.config/init/vars

typeset -i choice
nums=()
lines=""

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

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]