From 3a3286c83a5efd337a6ca11f46b484349b78c075 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 22 Mar 2013 13:22:36 +0100 Subject: [PATCH] herbstluftwm: Replace old config with fresh one --- .config/herbstluftwm/autostart | 171 +++++++++++++++++++++------------ 1 file changed, 108 insertions(+), 63 deletions(-) diff --git a/.config/herbstluftwm/autostart b/.config/herbstluftwm/autostart index cf9b852..a74f1aa 100755 --- a/.config/herbstluftwm/autostart +++ b/.config/herbstluftwm/autostart @@ -1,77 +1,122 @@ -#!/bin/zsh +#!/bin/bash -function hc () { - herbstclient $@ +# this is a simple config for herbstluftwm + +function hc() { + herbstclient "$@" } -modkey="Mod4" +hc emit_hook reload -hc keybind $modkey+Ctrl+b resize left +0.05 -hc keybind $modkey+Ctrl+f resize right +0.05 -hc keybind $modkey+Ctrl+n resize down +0.05 -hc keybind $modkey+Ctrl+p resize up +0.05 -hc keybind $modkey+Ctrl+q quit -hc keybind $modkey+Ctrl+r reload -hc keybind $modkey+Shift+1 spawn dmenu_run -p 'Run:' -b -nb '#111113' -nf '#eeeeec' -sb '#171719' -hc keybind $modkey+Shift+b shift left -hc keybind $modkey+Shift+f shift right -hc keybind $modkey+Shift+n shift down -hc keybind $modkey+Shift+p shift up -hc keybind $modkey+Shift+s split horizontal 0.5 -hc keybind $modkey+b focus -i left -hc keybind $modkey+c spawn urxvt -hc keybind $modkey+comma cycle_monitor -1 -hc keybind $modkey+e spawn emacsclient -ca emacs -hc keybind $modkey+f focus -i right -hc keybind $modkey+k close -hc keybind $modkey+n focus -i down -hc keybind $modkey+o cycle_all -hc keybind $modkey+p focus -i up -hc keybind $modkey+period cycle_monitor 1 -hc keybind $modkey+q remove -hc keybind $modkey+s split vertical 0.5 -hc keybind $modkey+space cycle_layout 1 -hc keybind $modkey+w spawn conkeror -hc keybind Ctrl+Mod1+l spawn i3lock -c 000000 -hc keybind XF86AudioNext spawn mpc next -hc keybind XF86AudioPlay spawn mpc toggle -hc keybind XF86AudioPrev spawn mpc prev -hc keybind XF86AudioStop spawn mpc stop +# remove all existing keybindings +hc keyunbind --all -hc set default_frame_layout 2 -hc set focus_stealing_prevention 0 -hc set frame_bg_transparent 1 -hc set frame_border_width 0 -hc set raise_on_focus 1 -hc set window_border_active_color "#999999" -hc set window_border_normal_color "#222224" -hc set window_border_width 1 +# keybindings +Mod=Mod4 +hc keybind $Mod-Shift-q quit +hc keybind $Mod-Shift-r reload +hc keybind $Mod-Shift-c close -hc set_layout max +hc keybind $Mod-c spawn urxvt +hc keybind $Mod-e spawn emacsclient -ca emacs +hc keybind $Mod-w spawn conkeror -hc add default2 -hc remove_monitor 1 -hc move_monitor 0 1920x1080+0+0 -hc add_monitor 1680x1050+1920+0 default2 +# tags +TAG_NAMES=( {1..9} ) +TAG_KEYS=( {1..9} 0 ) -hc pad 0 20 -5 -5 -5 -hc pad 1 -5 -5 -5 -5 +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 -hc mousebind $modkey-Button1 move -hc mousebind $modkey-Button2 resize -hc mousebind $modkey-Button3 zoom +# cycle through tags +hc keybind $Mod-period use_index +1 --skip-visible +hc keybind $Mod-comma use_index -1 --skip-visible +hc keybind $Mod-Right use_index +1 --skip-visible +hc keybind $Mod-Left use_index -1 --skip-visible +# 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-b focus left +hc keybind $Mod-n focus down +hc keybind $Mod-p focus up +hc keybind $Mod-f focus right +hc keybind $Mod-i jumpto urgent +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 '#222222' +hc set frame_border_normal_color '#101010' +hc set frame_bg_normal_color '#565656' +hc set frame_bg_active_color '#345F0C' +hc set frame_border_width 1 +hc set window_border_width 3 +hc set window_border_inner_width 1 +hc set window_border_normal_color '#454545' +hc set window_border_active_color '#9fbc00' +hc set always_show_frame 1 +hc set frame_gap 4 +# add overlapping window borders +hc set window_gap -2 +hc set frame_padding 2 +hc set smart_window_surroundings 0 +hc set smart_frame_surroundings 1 +hc set mouse_recenter_gap 0 + + +# rules hc unrule -F -hc rule focus=on -hc rule windowtype=_NET_WM_WINDOW_TYPE_DIALOG focus=on pseudotile=on -hc rule class=Xephyr pseudotile=on -hc rule instance=Xine\ Window pseudotile=on -hc rule class=Pinentry pseudotile=on -hc rule class=Dispass pseudotile=on -hc rule title="GIMP Startup" pseudotile=on +#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 -# xbindkeys +# unlock, just to be sure +hc unlock -# ~/.config/herbstluftwm/panel.sh & +herbstclient set tree_style '╾│ ├└╼─┐' -# hc load default "(split horizontal:0.550000:0 (split vertical:0.850000:0 (split horizontal:0.180000:1 (clients max:0) (clients max:0 0x140001a)) (clients max:0)) (clients max:0 0xc00077))" +# do multi monitor setup here, e.g.: +# hc set_monitors 1280x1024+0+0 1280x1024+1280+0 +# or simply: +# hc detect_monitors + +hc set_monitors 1920x1080+0+0 1680x1050+1920+0 +hc pad 0 21