code / scripts

Lines748 Shell528 Python72 Lua67 Bourne Again Shell62 make15
1 others 4
Markdown4
(16 lines)
1 #!/bin/sh
2 # Herbstluftwm: Pick a window
3 clients="$(
4 herbstclient stack |
5 awk '/Normal Layer/{output=1; next} output&&!/Client/{exit} output{print $0}' |
6 sed -n 's/.* Client \(0x[0-9a-f]*\) "\(.*\)"/\1 \2/p'
7 )"
8 picked="$(
9 echo "$clients" |
10 awk '{$1=NR} {print substr($0,1,50)}' |
11 dmenu -i -c -l 10 -sb '#ecb108' -sf '#251d18' |
12 awk '{print $1}'
13 )"
14 [ ! "$picked" ] && exit 1
15 target="$(echo "$clients" | sed -n "${picked}p")"
16 herbstclient jumpto "$target"