.config/herbstluftwm/autostart

This commit is contained in:
Tom Willemsen 2012-01-18 11:55:38 +01:00
parent fa5d16d01a
commit f51ba4c8c5

View file

@ -1,133 +1,89 @@
#!/usr/local/bin/guile #!/bin/zsh
!#
(define (hc command) function hc () {
"Calls the herbstclient program to execute a command" herbstclient $@
(system (string-append "herbstclient " command))) }
(define (keybind modkey key command) modkey="Mod4"
"Binds a keyboard key to a command, also prints it for testing
purposes"
(display (string-append "keybind " modkey "-" key " " command "\n"))
(hc (string-append "keybind " modkey "-" key " " command)))
(define (mousebind modkey button command) # Looks
"Binds a mouse button to a command" hc set frame_bg_normal_color "#0c191c"
(hc (string-append "mousebind " modkey "-" button " " command))) hc set frame_bg_active_color "#000000"
hc set frame_border_width 0
hc set window_border_width 1
hc set window_border_normal_color "#15abc3"
hc set window_border_active_color "#e0c625"
(define (add-tag name) # Layout
"Create a new tag" hc set default_frame_layout 2
(hc (string-append "add " name))) hc set_layout max
(define (set variable value) # Tags
"Set the value of a variable" hc rename default q
(hc (string-append "set " variable " " value))) tagnames=(q w e a s d z x c)
for tag in ${tagnames[@]}; do
hc add $tag
hc keybind $modkey-$tag use $tag
hc keybind $modkey-Shift-$tag move $tag
done
(define (unrule) # Monitors
"Clear all rules from memory" hc remove_monitor 1
(hc "unrule -F")) hc move_monitor 0 1920x1080+0+0
hc add_monitor 1680x1050+1920+0 w
(define (rule spec) # Keys
"Add a new rule" hc keybind $modkey-Mod1-q quit
(hc (string-append "rule " spec))) hc keybind $modkey-Mod1-r reload
hc keybind $modkey-Shift-Mod1-c close
hc keybind $modkey-Return spawn urxvt
hc keybind $modkey-r spawn dmenu_run \
-fn "-misc-tamsyn-medium-r-normal-*-14-*-*-*-*-*-iso8859-*" \
-nb "#000000" -nf "#15abc3"
hc keybind Control-Mod1-l spawn i3lock -c 000000
hc keybind $modkey-t spawn ~/bin/hlwm/capture-todo
hc keybind $modkey-Shift-t spawn ~/bin/hlwm/show-todo
(define modkey "Mod4") hc keybind $modkey-Shift-r remove
hc keybind $modkey-space cycle_layout 1
hc keybind $modkey-u split vertical 0.5
hc keybind $modkey-o split horizontal 0.5
hc keybind $modkey-Mod1-f floating toggle
hc keybind $modkey-Mod1-Shift-f fullscreen toggle
hc keybind $modkey-Mod1-p pseudotile toggle
(define (create-tag name) hc keybind $modkey-Control-b resize left +0.05
(add-tag name) hc keybind $modkey-Control-n resize down +0.05
(keybind modkey name (string-append "use " name)) hc keybind $modkey-Control-p resize up +0.05
(keybind modkey hc keybind $modkey-Control-f resize right +0.05
(string-append "Shift-" name)
(string-append "move " name)))
(define (dmenu-command fn nb nf) hc keybind $modkey-BackSpace cycle_monitor
(string-append "dmenu_run -fn '" fn "' -nb '" nb "' -nf '" nf "'")) hc keybind $modkey-Tab cycle_all +1
hc keybind $modkey-Shift-Tab cycle_all -1
hc keybind $modkey-Mod1-c cycle
hc keybind $modkey-b focus left
hc keybind $modkey-n focus down
hc keybind $modkey-p focus up
hc keybind $modkey-f focus right
hc keybind $modkey-Shift-b shift left
hc keybind $modkey-Shift-n shift down
hc keybind $modkey-Shift-p shift up
hc keybind $modkey-Shift-f shift right
(define (set-layout layout) # Mouse
(display (string-append "set_layout " layout "\n")) hc mousebind $modkey-Button1 move
(hc (string-append "set_layout " layout))) hc mousebind $modkey-Button2 resize
hc mousebind $modkey-Button3 zoom
;; colors # Rules
(set "frame_bg_normal_color" "\\#0c191c") hc unrule -F
(set "frame_bg_active_color" "\\#000000") hc rule focus=on
(set "frame_border_width" "0") hc rule windowtype=_NET_WM_WINDOW_TYPE_DIALOG focus=on pseudotile=on
(set "window_border_width" "1") hc rule class=Xephyr pseudotile=on
(set "window_border_normal_color" "\\#0c191c")
(set "window_border_active_color" "\\#15abc3")
;; other settings # Panel
(set "default_frame_layout" "2") ~/.config/herbstluftwm/panel.sh &
(set-layout "max")
;; keybindings # Local Variables:
(keybind modkey "Mod1-q" "quit") # eval: (git-auto-commit-mode 1)
(keybind modkey "Mod1-r" "reload") # End:
(keybind modkey "Shift-Mod1-c" "close")
(keybind modkey "Return" "spawn urxvt")
(keybind modkey "r"
(string-append
"spawn "
(dmenu-command
"-misc-tamsyn-medium-r-normal-*-14-*-*-*-*-*-iso8859-*"
"#000000" "#15abc3")))
(keybind "Control" "Mod1-l" "spawn i3lock -c 000000")
(keybind modkey "t" "spawn ~/bin/hlwm/capture-todo")
(keybind modkey "Shift-t" "spawn ~/bin/hlwm/show-todo")
;; tags
(hc "rename default q")
(for-each create-tag '("q" "w" "e" "a" "s" "d" "z" "x" "c"))
;; layout
(hc "remove_monitor 1")
(hc "move_monitor 0 1680x1050+0+0")
(hc "add_monitor 1280x1024+1680+0 w")
;; layouting
(keybind modkey "Shift-r" "remove")
(keybind modkey "space" "cycle_layout 1")
(keybind modkey "u" "split vertical 0.5")
(keybind modkey "o" "split horizontal 0.5")
(keybind modkey "Mod1-f" "floating toggle")
(keybind modkey "Mod1-Shift-f" "fullscreen toggle")
(keybind modkey "Mod1-p" "pseudotile toggle")
;; resizing
(define resizestep "0.05")
(keybind modkey "Control-b" (string-append "resize left +" resizestep))
(keybind modkey "Control-n" (string-append "resize down +" resizestep))
(keybind modkey "Control-p" (string-append "resize up +" resizestep))
(keybind modkey "Control-f" (string-append "resize right +" resizestep))
;; mouse
(mousebind modkey "Button1" "move")
(mousebind modkey "Button2" "resize")
(mousebind modkey "Button3" "zoom")
;; focus
(keybind modkey "BackSpace" "cycle_monitor")
(keybind modkey "Tab" "cycle_all +1")
(keybind modkey "Shift-Tab" "cycle_all -1")
(keybind modkey "Mod1-c" "cycle")
(keybind modkey "b" "focus left")
(keybind modkey "n" "focus down")
(keybind modkey "p" "focus up")
(keybind modkey "f" "focus right")
(keybind modkey "Shift-b" "shift left")
(keybind modkey "Shift-n" "shift down")
(keybind modkey "Shift-p" "shift up")
(keybind modkey "Shift-f" "shift right")
;; rules
(unrule)
(rule "focus=on") ; normally do not focus new clients
(rule "windowtype=_NET_WM_WINDOW_TYPE_DIALOG focus=on pseudotile=on")
(rule "class=Xephyr pseudotile=on")
;; Show panel
(system "~/.config/herbstluftwm/panel.sh &")
;; Local Variables:
;; eval: (git-auto-commit-mode 1)
;; End: