From 91c231a2223440081426929828a23c7baa0214fd Mon Sep 17 00:00:00 2001 From: Florian Pelz Date: Thu, 9 Apr 2020 02:17:22 +0200 Subject: installer: Allow Alt+Shift toggle from non-Latin keyboard layouts. Fixes . * gnu/installer/newt/keymap.scm (%non-latin-layouts): New variable. (%non-latin-variants): New variable. (%latin-layout+variants): New variable. (toggleable-latin-layout): New procedure to compute combined layouts. (run-keymap-page): Use it. (keyboard-layout->configuration): Apply it in config.scm. (run-layout-page): Mention Alt+Shift. * gnu/installer/keymap.scm (kmscon-update-keymap): Pass on XKB options. * gnu/installer/record.scm (): Adjust code comments. * gnu/installer.scm (apply-keymap): Pass on XKB options. (installer-steps): Adjust code comments. * gnu/packages/patches/kmscon-runtime-keymap-switch.patch: Apply XKB options. --- gnu/installer.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'gnu/installer.scm') diff --git a/gnu/installer.scm b/gnu/installer.scm index 6cd3995e51..d2b7fc327d 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2020 Mathieu Othacehe ;;; Copyright © 2019, 2020 Ludovic Courtès ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice +;;; Copyright © 2020 Florian Pelz ;;; ;;; This file is part of GNU Guix. ;;; @@ -170,9 +171,9 @@ been performed at build time." (define apply-keymap ;; Apply the specified keymap. Use the default keyboard model. #~(match-lambda - ((layout variant) + ((layout variant options) (kmscon-update-keymap (default-keyboard-model) - layout variant)))) + layout variant options)))) (define* (compute-keymap-step context) "Return a gexp that runs the keymap-page of INSTALLER and install the @@ -235,12 +236,13 @@ selected keymap." ;; The installer runs in a kmscon virtual terminal where loadkeys ;; won't work. kmscon uses libxkbcommon as a backend for keyboard - ;; input. It is possible to update kmscon current keymap by sending it - ;; a keyboard model, layout and variant, in a somehow similar way as - ;; what is done with setxkbmap utility. + ;; input. It is possible to update kmscon current keymap by sending + ;; it a keyboard model, layout, variant and options, in a somehow + ;; similar way as what is done with setxkbmap utility. ;; ;; So ask for a keyboard model, layout and variant to update the - ;; current kmscon keymap. + ;; current kmscon keymap. For non-Latin layouts, we add an + ;; appropriate second layout and toggle via Alt+Shift. (installer-step (id 'keymap) (description (G_ "Keyboard mapping selection")) -- cgit v1.2.3