mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-25 20:19:18 -05:00
installer: keymap: Do not fail on non-kmscon terminals.
kmscon-update-keymap fails on non kmscon terminals because KEYMAP_UPDATE environment variable is not defined. As it is convenient to test the installer on a regular terminal, do nothing if KEYMAP_UPDATE is missing. * gnu/installer/keymap.scm (kmscon-update-keymap): Do nothing if KEYMAP_UPDATE is not defined.
This commit is contained in:
parent
7d812901da
commit
479414e1c9
1 changed files with 18 additions and 12 deletions
|
@ -149,11 +149,17 @@ (define (layout l)
|
||||||
(values models layouts)))))
|
(values models layouts)))))
|
||||||
|
|
||||||
(define (kmscon-update-keymap model layout variant)
|
(define (kmscon-update-keymap model layout variant)
|
||||||
(let ((keymap-file (getenv "KEYMAP_UPDATE")))
|
"Update kmscon keymap with the provided MODEL, LAYOUT and VARIANT."
|
||||||
(unless (and keymap-file
|
(and=>
|
||||||
(file-exists? keymap-file))
|
(getenv "KEYMAP_UPDATE")
|
||||||
|
(lambda (keymap-file)
|
||||||
|
(unless (file-exists? keymap-file)
|
||||||
(error "Unable to locate keymap update file"))
|
(error "Unable to locate keymap update file"))
|
||||||
|
|
||||||
|
;; See file gnu/packages/patches/kmscon-runtime-keymap-switch.patch.
|
||||||
|
;; This dirty hack makes possible to update kmscon keymap at runtime by
|
||||||
|
;; writing an X11 keyboard model, layout and variant to a named pipe
|
||||||
|
;; referred by KEYMAP_UPDATE environment variable.
|
||||||
(call-with-output-file keymap-file
|
(call-with-output-file keymap-file
|
||||||
(lambda (port)
|
(lambda (port)
|
||||||
(format port model)
|
(format port model)
|
||||||
|
@ -163,4 +169,4 @@ (define (kmscon-update-keymap model layout variant)
|
||||||
(put-u8 port 0)
|
(put-u8 port 0)
|
||||||
|
|
||||||
(format port variant)
|
(format port variant)
|
||||||
(put-u8 port 0)))))
|
(put-u8 port 0))))))
|
||||||
|
|
Loading…
Reference in a new issue