gnu: r-wgcna: Move to (gnu packages bioconductor).
[jackhill/guix/guix.git] / gnu / installer / keymap.scm
index d66b376..c42b308 100644 (file)
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,6 +37,7 @@
             make-x11-keymap-layout
             x11-keymap-layout?
             x11-keymap-layout-name
+            x11-keymap-layout-synopsis
             x11-keymap-layout-description
             x11-keymap-layout-variants
 
@@ -60,7 +62,8 @@
   x11-keymap-layout make-x11-keymap-layout
   x11-keymap-layout?
   (name            x11-keymap-layout-name) ;string
-  (description     x11-keymap-layout-description) ;string
+  (synopsis        x11-keymap-layout-synopsis)    ;string (e.g., "en")
+  (description     x11-keymap-layout-description) ;string (a whole phrase)
   (variants        x11-keymap-layout-variants)) ;list of <x11-keymap-variant>
 
 (define-record-type* <x11-keymap-variant>
@@ -117,6 +120,8 @@ Configuration Database, describing possible XKB configurations."
                   (variantList ,[variant -> v] ...))
                  (x11-keymap-layout
                   (name name)
+                  (synopsis (car
+                             (assoc-ref rest-layout 'shortDescription)))
                   (description (car
                                 (assoc-ref rest-layout 'description)))
                   (variants (list v ...)))]
@@ -126,6 +131,8 @@ Configuration Database, describing possible XKB configurations."
                    . ,rest-layout))
                  (x11-keymap-layout
                   (name name)
+                  (synopsis (car
+                             (assoc-ref rest-layout 'shortDescription)))
                   (description (car
                                 (assoc-ref rest-layout 'description)))
                   (variants '()))]))
@@ -148,8 +155,8 @@ Configuration Database, describing possible XKB configurations."
       ((models layouts)
        (values models layouts)))))
 
-(define (kmscon-update-keymap model layout variant)
-  "Update kmscon keymap with the provided MODEL, LAYOUT and VARIANT."
+(define (kmscon-update-keymap model layout variant options)
+  "Update kmscon keymap with the provided MODEL, LAYOUT, VARIANT and OPTIONS."
   (and=>
    (getenv "KEYMAP_UPDATE")
    (lambda (keymap-file)
@@ -168,5 +175,8 @@ Configuration Database, describing possible XKB configurations."
          (format port layout)
          (put-u8 port 0)
 
-         (format port variant)
+         (format port (or variant ""))
+         (put-u8 port 0)
+
+         (format port (or options ""))
          (put-u8 port 0))))))