code / scripts

Lines748 Shell528 Python72 Lua67 Bourne Again Shell62 make15
1 others 4
Markdown4
(27 lines)
1 #!/bin/sh
2 # Herbstluftwm: unhide a window
3 dwm_pick() {
4 clients="$(wmctrl -l | awk '{$3=""; $2=""; print $0}')"
5 picked="$(
6 echo "$clients" |
7 awk '{$1=NR} {print substr($0,1,50)}' |
8 dmenu -i -fn 'Inconsolata:size=16' -c -l 10 -sb '#ecb108' -sf '#251d18' |
9 awk '{print $1}'
10 )"
11 [ ! "$picked" ] && exit 1
12 echo "$clients" | sed -n "${picked}p"
15 #target=$(dwm_pick)
16 #herbstclient jumpto "$target"
17 #hidden_tag="-"
18 #herbstclient bring "$target"
20 orig_tag=$(herbstclient get_attr clients.focus.tag)
21 orig_index=$(herbstclient get_attr tags.by-name."$orig_tag".index)
22 herbstclient chain , use_index 6 , set_layout grid \
23 , keybind h focus left , keybind j focus down , keybind k focus up , keybind l focus right \
24 , keybind Left focus left , keybind Down focus down , keybind Up focus up , keybind Right focus right \
25 , keybind Return chain @ move_index "$orig_index" @ use_index "$orig_index" \
26 @ keyunbind Left @ keyunbind Down @ keyunbind Up @ keyunbind Right \
27 @ keyunbind h @ keyunbind j @ keyunbind k @ keyunbind l @ keyunbind Return