mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-02-16 17:12:11 +00:00
services: %rosenthal-set-keymap-script: Adapt to installer environment.
This helps to invoke the script directly from Guix's installer. * modules/rosenthal/services/desktop.scm (%rosenthal-set-keymap-script): Output keymap to temporary file. Always change niri configuration.
This commit is contained in:
parent
444f54f9f2
commit
f549c7604c
@ -504,19 +504,24 @@ gtk-key-theme-name = ~a~%"
|
||||
(dump-port pipe output))))
|
||||
|
||||
(define* (set-keyboard-layout layout #:optional variant #:key model options)
|
||||
(define file-name "/tmp/keymaps/console-keymap")
|
||||
(define file-name (tmpnam))
|
||||
(build-keyboard-layout file-name layout variant #:model model #:options options)
|
||||
(invoke "sudo" #$(file-append (spec->pkg "kbd") "/bin/loadkeys") file-name)
|
||||
(when (getenv "WAYLAND_DISPLAY")
|
||||
(substitute* (in-vicinity (getenv "XDG_CONFIG_HOME") "niri/config.kdl")
|
||||
(("^ (layout|variant|model|options) .*") "")
|
||||
(("^ xkb \\{.*" line)
|
||||
(string-append
|
||||
line
|
||||
(format #f " layout ~s~%" layout)
|
||||
(if variant (format #f " variant ~s~%" variant) "")
|
||||
(if model (format #f " model ~s~%" model) "")
|
||||
(format #f " options ~s~%" (string-join options ",")))))))
|
||||
(false-if-exception
|
||||
(substitute*
|
||||
(in-vicinity
|
||||
(if (zero? (getuid))
|
||||
"/home/live/.config"
|
||||
(getenv "XDG_CONFIG_HOME"))
|
||||
"niri/config.kdl")
|
||||
(("^ (layout|variant|model|options) .*") "")
|
||||
(("^ xkb \\{.*" line)
|
||||
(string-append
|
||||
line
|
||||
(format #f " layout ~s~%" layout)
|
||||
(if variant (format #f " variant ~s~%" variant) "")
|
||||
(if model (format #f " model ~s~%" model) "")
|
||||
(format #f " options ~s~%" (string-join options ",")))))))
|
||||
|
||||
(define (show-help-and-exit)
|
||||
(display "\
|
||||
|
||||
Loading…
Reference in New Issue
Block a user