guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: system: Allow for comma-separated keyboard layout


From: guix-commits
Subject: branch master updated: system: Allow for comma-separated keyboard layouts.
Date: Sun, 05 Apr 2020 18:14:34 -0400

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 2729cb4  system: Allow for comma-separated keyboard layouts.
2729cb4 is described below

commit 2729cb406d9f3e9eb22cc660f887138134edb3a8
Author: Ludovic Courtès <address@hidden>
AuthorDate: Sun Apr 5 23:37:33 2020 +0200

    system: Allow for comma-separated keyboard layouts.
    
    Reported by Florian Pelz <address@hidden>.
    
    * gnu/bootloader/grub.scm (keyboard-layout-file): Replace commas with
    hyphens in the first argument to 'computed-file'.
    * gnu/system/keyboard.scm (keyboard-layout->console-keymap): Likewise.
    * doc/guix.texi (Keyboard Layout): Add example.
---
 doc/guix.texi           | 3 +++
 gnu/bootloader/grub.scm | 6 +++++-
 gnu/system/keyboard.scm | 7 +++++--
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index bc56024..67cedae 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11916,6 +11916,9 @@ about.  Here are a few example:
 ;; The Catalan layout.
 (keyboard-layout "es" "cat")
 
+;; Arabic layout with "Alt-Shift" to switch to US layout.
+(keyboard-layout "ar,us" #:options '("grp:alt_shift_toggle"))
+
 ;; The Latin American Spanish layout.  In addition, the
 ;; "Caps Lock" key is used as an additional "Ctrl" key,
 ;; and the "Menu" key is used as a "Compose" key to enter
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 28e6cb1..190b717 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -240,7 +240,11 @@ the 'share/X11/xkb/symbols/' directory of 
'xkeyboard-config'."
                   "-i" #+(keyboard-layout->console-keymap layout)
                   "-o" #$output))))
 
-  (computed-file (string-append "grub-keymap." (keyboard-layout-name layout))
+  (computed-file (string-append "grub-keymap."
+                                (string-map (match-lambda
+                                              (#\, #\-)
+                                              (chr chr))
+                                            (keyboard-layout-name layout)))
                  builder))
 
 (define (grub-setup-io config)
diff --git a/gnu/system/keyboard.scm b/gnu/system/keyboard.scm
index cd3ab37..5bd13a4 100644
--- a/gnu/system/keyboard.scm
+++ b/gnu/system/keyboard.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019 Ludovic Courtès <address@hidden>
+;;; Copyright © 2019, 2020 Ludovic Courtès <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -94,5 +94,8 @@ Layout information is taken from the XKEYBOARD-CONFIG 
package."
                    #$(keyboard-layout-name layout))))))
 
   (computed-file (string-append "console-keymap."
-                                (keyboard-layout-name layout))
+                                (string-map (match-lambda
+                                              (#\, #\-)
+                                              (chr chr))
+                                            (keyboard-layout-name layout)))
                  build))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]