Skip to content

Instantly share code, notes, and snippets.

@asciimoo
Created December 30, 2011 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asciimoo/1539803 to your computer and use it in GitHub Desktop.
Save asciimoo/1539803 to your computer and use it in GitHub Desktop.
my herbstluftwm autostart script
#!/bin/bash
# this is a simple config for herbstluftwm
function hc() {
/usr/bin/herbstclient "$@"
}
hc emit_hook reload
# keybindings
Mod=Mod4
hc keybind $Mod-Return spawn urxvtc
# tags
TAG_NAMES=(term web audio im gimp 6 7 8 9 0)
TAG_KEYS=( {1..10} 0 )
hc rename default "${TAG_NAMES[0]}" || true
for i in ${!TAG_NAMES[@]} ; do
hc add "${TAG_NAMES[$i]}"
key="${TAG_KEYS[$i]}"
if ! [ -z "$key" ] ; then
hc keybind "$Mod-$key" use "${TAG_NAMES[$i]}"
hc keybind "$Mod-Shift-$key" move "${TAG_NAMES[$i]}"
fi
done
# layouting
hc keybind $Mod-r remove
hc keybind $Mod-space cycle_layout 1
hc keybind $Mod-u split vertical 0.5
hc keybind $Mod-o split horizontal 0.5
hc keybind $Mod-s floating toggle
hc keybind $Mod-f fullscreen toggle
hc keybind $Mod-p pseudotile toggle
# resizing
RESIZESTEP=0.05
hc keybind $Mod-Control-h resize left +$RESIZESTEP
hc keybind $Mod-Control-j resize down +$RESIZESTEP
hc keybind $Mod-Control-k resize up +$RESIZESTEP
hc keybind $Mod-Control-l resize right +$RESIZESTEP
# mouse
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 resize
hc mousebind $Mod-Button3 zoom
# focus
hc keybind $Mod-BackSpace cycle_monitor
hc keybind $Mod-Tab cycle +1
hc keybind $Mod-Shift-Tab cycle -1
hc keybind $Mod-Shift c cycle
hc keybind $Mod-h focus left
hc keybind $Mod-j focus down
hc keybind $Mod-k focus up
hc keybind $Mod-l focus right
hc keybind $Mod-Shift-h shift left
hc keybind $Mod-Shift-j shift down
hc keybind $Mod-Shift-k shift up
hc keybind $Mod-Shift-l shift right
hc keybind $Mod-i spawn urxvtc -name log -e sudo /usr/bin/grc $HOME'/bin/log' +ss
hc keybind $Mod-c spawn dmenu_run
hc keybind $Mod-F8 spawn xset dpms force off
hc keybind $Mod-q reload
hc keybind $Mod-Control-r quit
hc keybind $Mod-Control-x close
# colors
hc set frame_border_active_color '#FF0066'
hc set frame_border_normal_color '#000000'
#hc set frame_bg_normal_color '#000000'
#hc set frame_bg_active_color '#111111'
hc set frame_bg_transparent 1
hc set frame_border_width 1
hc set window_border_width 2
hc set window_border_normal_color '#000000'
hc set window_border_active_color '#3366FF'
hc set snap_distance 1
hc set snap_gap 1
hc set window_gap 0
hc set default_frame_layout 2
hc pad 0 14 0 0 0
herbstclient set tree_style '╾│ ├╰╼─╮'
hc load term '(split vertical:0.900000:0 (clients max:0 0x400007 0x1200077) (clients grid:0 0xe00007))'
hc load gimp '
(split horizontal:0.850000:0
(split horizontal:0.200000:1
(clients vertical:0)
(clients grid:0))
(clients vertical:0))
' # load predefined layout
# center all other gimp windows on gimp tag
hc rule class=Gimp tag=gimp index=01 pseudotile=on
hc rule class=Gimp windowrole~'gimp-(image-window|toolbox|dock)' pseudotile=off
hc rule class=Gimp windowrole=gimp-toolbox focus=off index=00
hc rule class=Gimp windowrole=gimp-dock focus=off index=1
# rules
hc unrule -F
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hc rule focus=on # normally focus new clients
# give focus to most common terminals
#hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
hc rule class~'([Mm][Pp]layer)' focus=on
hc rule class~'([Mm][Pp]layer)' pseudotile=on
hc rule class~'log' index=10
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment