mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-02-17 01:22:04 +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))))
|
(dump-port pipe output))))
|
||||||
|
|
||||||
(define* (set-keyboard-layout layout #:optional variant #:key model options)
|
(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)
|
(build-keyboard-layout file-name layout variant #:model model #:options options)
|
||||||
(invoke "sudo" #$(file-append (spec->pkg "kbd") "/bin/loadkeys") file-name)
|
(invoke "sudo" #$(file-append (spec->pkg "kbd") "/bin/loadkeys") file-name)
|
||||||
(when (getenv "WAYLAND_DISPLAY")
|
(false-if-exception
|
||||||
(substitute* (in-vicinity (getenv "XDG_CONFIG_HOME") "niri/config.kdl")
|
(substitute*
|
||||||
(("^ (layout|variant|model|options) .*") "")
|
(in-vicinity
|
||||||
(("^ xkb \\{.*" line)
|
(if (zero? (getuid))
|
||||||
(string-append
|
"/home/live/.config"
|
||||||
line
|
(getenv "XDG_CONFIG_HOME"))
|
||||||
(format #f " layout ~s~%" layout)
|
"niri/config.kdl")
|
||||||
(if variant (format #f " variant ~s~%" variant) "")
|
(("^ (layout|variant|model|options) .*") "")
|
||||||
(if model (format #f " model ~s~%" model) "")
|
(("^ xkb \\{.*" line)
|
||||||
(format #f " options ~s~%" (string-join options ",")))))))
|
(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)
|
(define (show-help-and-exit)
|
||||||
(display "\
|
(display "\
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user