Closed Frewacom closed 1 year ago
Setting multiple keys/rules could look something like below. Not sure about the exact function names though.
;; General variables
(setq border-px 10
root-color "#ffffff"
focus-color "#000000")
;; Bindings can be set as a symbol or procedure (lambda)
(define (my-callback)
(dwl:reload-config))
;; Run long running jobs in a new thread to prevent blocking of
;; dwl-guile main thread.
(define (my-non-blocking-callback)
(dwl:async-eval
(begin ...)))
;; Bind keys on keyboard ('keys)
(bind 'keys "S-[127]" 'my-callback
"S-<enter>" 'dwl:toggle-gaps
"S-<space>" (lambda () (dwl:reload-config))
"S-s-a" 'my-non-blocking-callback)
;; Bind mouse buttons ('buttons)
(bind 'buttons "S-<mouse-left>" 'dwl:move)
;; Rules, layouts, etc, accept a key as first argument which allows you to
;; easily override certain behaviour if needed.
(set-rules 'emacs '((id "emacs")
(alpha 1.0)
(swallow? #t))
'mpv '((id "mpv")
(alpha 1.0)
(swallow? #t)))
(set-monitors 'left '((name "HDMI-1") (x 0) (y 0))
'right '((name "DP-1") (x 0) (y 1080)))
(set-layouts 'tile "[]=" 'dwl:tile
'monocle "|M|" 'dwl:monocle
'fib "[@]" 'my-patch:fibonacci)
(add-xkb-config '((rules "...") (options "...")))
Added in v2.0.0.
Update config parser to use an Emacs-like configuration (see also https://github.com/engstrand-config/home-service-dwl-guile/issues/9).
This allows for a much more user-friendly configuration experience, as well as making it feasible to use dwl-guile without the Guix home-service. Settings can also easily be modified during runtime using
dwl-guile -e "<exp>"
.The config should look something like this: