aboutsummaryrefslogtreecommitdiffstats
path: root/oni/home/services/herbstluftwm.scm
diff options
context:
space:
mode:
Diffstat (limited to 'oni/home/services/herbstluftwm.scm')
-rw-r--r--oni/home/services/herbstluftwm.scm20
1 files changed, 17 insertions, 3 deletions
diff --git a/oni/home/services/herbstluftwm.scm b/oni/home/services/herbstluftwm.scm
index caa78df..70aa916 100644
--- a/oni/home/services/herbstluftwm.scm
+++ b/oni/home/services/herbstluftwm.scm
@@ -8,6 +8,7 @@
#:use-module (guix gexp)
#:use-module (oni home services xinit)
#:use-module (oni gexp)
+ #:use-module (oni kbd)
#:use-module (srfi srfi-1)
#:export (home-herbstluftwm-service-type
@@ -17,6 +18,9 @@
(package
(package herbstluftwm)
"Package use for setting herbstluftwm")
+ (key-bindings
+ (alist '())
+ "Key bindings")
(mouse-bindings
(alist '())
"Mouse bindings")
@@ -48,17 +52,27 @@
(define (add-herbstluftwm-packages config)
(list (home-herbstluftwm-configuration-package config) zsh))
+(define (build-keybindings bindings)
+ (append
+ (list "herbstclient keyunbind --all\n")
+ (map (lambda (binding)
+ (format #f "herbstclient keybind ~a ~a\n"
+ (kbd (car binding)) (cdr binding)))
+ bindings)))
+
(define (home-herbstluftwm-autostart-file config)
(apply mixed-executable-file
"autostart"
"#!" zsh "/bin/zsh\n"
"herbstclient emit_hook reload\n"
- "herbstclient keyunbind --all\n"
(let ((tags (home-herbstluftwm-configuration-tags config)))
- (append (list "herbstclient mouseunbind --all\n")
+ (append (build-keybindings
+ (home-herbstluftwm-configuration-key-bindings config))
+
+ (list "herbstclient mouseunbind --all\n")
(map (lambda (binding)
(format #f "herbstclient mousebind ~a ~a\n"
- (car binding) (cdr binding)))
+ (kbd (car binding)) (cdr binding)))
(home-herbstluftwm-configuration-mouse-bindings config))
(map (lambda (setting)
(format #f "herbstclient set ~s ~s\n"