Skip to content

Instantly share code, notes, and snippets.

@meskarune
Created October 7, 2012 20:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meskarune/3849471 to your computer and use it in GitHub Desktop.
Save meskarune/3849471 to your computer and use it in GitHub Desktop.
herbstluftwm config
#!/bin/bash
# this is a simple config for herbstluftwm
function hc() {
herbstclient "$@"
}
hc emit_hook reload
xsetroot -solid '#5A8E3A'
# remove all existing keybindings
hc keyunbind --all
# keybindings
Mod=Super
hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-Shift-c close
hc keybind $Mod-Return spawn urxvt
hc keybind $Mod-F3 spawn fbrun
# tags
TAG_NAMES=( {1..6} )
TAG_KEYS=( {1..6} 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_index "$i"
hc keybind "$Mod-Shift-$key" move_index "$i"
fi
done
# cycle through tags
hc keybind $Mod-period use_index +1
hc keybind $Mod-comma use_index -1
hc keybind $Mod-Right use_index +1
hc keybind $Mod-Left use_index -1
# 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 mouseunbind --all
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_all +1
hc keybind $Mod-Shift-Tab cycle_all -1
hc keybind $Mod-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
# colors
hc set frame_border_active_color '#215668'
hc set frame_border_normal_color '#101010'
hc set frame_bg_transparent 1
hc set frame_border_width 1
hc set window_border_width 1
hc set window_border_normal_color '#215668'
hc set window_border_active_color '#83b8e7'
hc set always_show_frame 1
hc set window_gap 4
hc set snap_distance 2
hc set snap_gap 2
# rules
hc unrule -F
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hc rule focus=off # normally do not focus new clients
# give focus to most common terminals
hc rule class~'(.*[Rr]xvt.*|.*[Tt]erm|Konsole)' focus=on
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
hc rule class~'[Ww]bar' manage=off
hc rule class~'[Cc]onky' manage=off
hc rule class~'[Ff]brun' pseudotile=on
#Padding for Wbar and Conky
hc pad 0 26 0 17 0
#Autostart Programs
#xcompmgr -c -r10 -F -f -D5 -C -o0.8 &
nitrogen --restore &
tint2 &
wicd-client &
thunar --daemon &
obmixer &
kupfer &
# unlock, just to be sure
hc unlock
# do multi monitor setup here, e.g.:
# hc remove_monitor 1
# hc move_monitor 0 1280x1024+0+0
# hc add_monitor 1280x1024+1280+0
# find the panel
#panel=~/.config/herbstluftwm/panel.sh
#[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
#for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
# # start it on each monitor
# $panel $monitor &
#done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment