legacy-dotfiles/.config/herbstluftwm/autostart

130 lines
3.9 KiB
Text
Raw Normal View History

2012-01-11 09:26:15 +01:00
#!/usr/bin/guile # -*- eval: (git-auto-commit-mode 1) -*-
2011-11-09 19:50:09 +01:00
!#
(define (hc command)
"Calls the herbstclient program to execute a command"
2011-11-09 19:50:09 +01:00
(system (string-append "herbstclient " command)))
(define (keybind modkey key command)
"Binds a keyboard key to a command, also prints it for testing
purposes"
2011-11-09 19:50:09 +01:00
(display (string-append "keybind " modkey "-" key " " command "\n"))
(hc (string-append "keybind " modkey "-" key " " command)))
(define (mousebind modkey button command)
"Binds a mouse button to a command"
2011-11-09 19:50:09 +01:00
(hc (string-append "mousebind " modkey "-" button " " command)))
(define (add-tag name)
"Create a new tag"
2011-11-09 19:50:09 +01:00
(hc (string-append "add " name)))
(define (set variable value)
"Set the value of a variable"
2011-11-09 19:50:09 +01:00
(hc (string-append "set " variable " " value)))
(define (unrule)
"Clear all rules from memory"
2011-11-09 19:50:09 +01:00
(hc "unrule -F"))
(define (rule spec)
"Add a new rule"
2011-11-09 19:50:09 +01:00
(hc (string-append "rule " spec)))
(define modkey "Mod4")
(define (create-tag name)
(add-tag name)
(keybind modkey name (string-append "use " name))
(keybind modkey
(string-append "Shift-" name)
(string-append "move " name)))
2011-11-17 13:40:36 +01:00
(define (dmenu-command fn nb nf)
(string-append "dmenu_run -fn '" fn "' -nb '" nb "' -nf '" nf "'"))
(define (set-layout layout)
(display (string-append "set_layout " layout "\n"))
(hc (string-append "set_layout " layout)))
;; colors
(set "frame_bg_normal_color" "\\#0c191c")
(set "frame_bg_active_color" "\\#000000")
(set "frame_border_width" "0")
(set "window_border_width" "1")
(set "window_border_normal_color" "\\#0c191c")
(set "window_border_active_color" "\\#15abc3")
;; other settings
(set "default_frame_layout" "2")
(set-layout "max")
2011-11-09 19:50:09 +01:00
;; keybindings
(keybind modkey "Mod1-q" "quit")
(keybind modkey "Mod1-r" "reload")
2011-12-01 22:38:55 +01:00
(keybind modkey "Shift-Mod1-c" "close")
2011-11-09 19:50:09 +01:00
(keybind modkey "Return" "spawn urxvt")
2011-11-17 13:40:36 +01:00
(keybind modkey "r"
(string-append
"spawn "
(dmenu-command
2011-12-23 13:38:22 +01:00
"-misc-tamsyn-medium-r-normal-*-14-*-*-*-*-*-iso8859-*"
"#000000" "#15abc3")))
2011-12-09 01:15:20 +01:00
(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")
2011-11-09 19:50:09 +01:00
;; tags
(hc "rename default q")
(for-each create-tag '("q" "w" "e" "a" "s" "d" "z" "x" "c"))
2011-11-09 19:50:09 +01:00
;; layout
(hc "remove_monitor 1")
2011-11-09 19:50:09 +01:00
(hc "move_monitor 0 1680x1050+0+0")
(hc "add_monitor 1280x1024+1680+0 w")
2011-11-09 19:50:09 +01:00
;; 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")
2011-11-09 19:50:09 +01:00
;; resizing
(define resizestep "0.05")
2012-01-10 21:21:11 +01:00
(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))
2011-11-09 19:50:09 +01:00
;; 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")
2011-11-09 19:50:09 +01:00
;; rules
(unrule)
(rule "focus=on") ; normally do not focus new clients
(rule "windowtype=_NET_WM_WINDOW_TYPE_DIALOG focus=on pseudotile=on")
2011-12-01 22:38:55 +01:00
(rule "class=Xephyr pseudotile=on")
2011-11-09 19:50:09 +01:00
;; Show panel
(system "~/.config/herbstluftwm/panel.sh &")