guix-commits
[Top][All Lists]
Advanced

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

02/80: installer: Fix broken keymap change option.


From: John Darrington
Subject: 02/80: installer: Fix broken keymap change option.
Date: Tue, 3 Jan 2017 15:49:41 +0000 (UTC)

jmd pushed a commit to branch wip-installer
in repository guix.

commit 4644086da9676c0ec5a4084c23705b829c2c4d58
Author: John Darrington <address@hidden>
Date:   Sat Dec 17 09:14:23 2016 +0100

    installer: Fix broken keymap change option.
    
    * gnu/system/installer/new.scm (base-page-key-handler): Use (which) instead 
of (getenv)
---
 gnu/system/installer/new.scm |   49 ++++++++++++++++++++++++------------------
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/gnu/system/installer/new.scm b/gnu/system/installer/new.scm
index 1e7ee19..4bac4cb 100644
--- a/gnu/system/installer/new.scm
+++ b/gnu/system/installer/new.scm
@@ -33,7 +33,10 @@
             (gnu system installer page)
             (gnu system installer dialog)
 
+             (guix build utils)
+             
             (ice-9 format)
+             (ice-9 match)
             (ice-9 pretty-print)
             (srfi srfi-9))
 
@@ -133,27 +136,31 @@
 
 
 (define (base-page-key-handler page ch)
-(cond
- ((eqv? ch (key-f 1))
-  (endwin)
-  (let* ((p (mkstemp! (string-copy "/tmp/installer.XXXXXX")))
-        (file-name (port-filename p)))
-    (format p "echo '~a'\n" (gettext "Type \"exit\" to return to the GuixSD 
installer."))
-    (close p)
-    (system* "bash" "--rcfile" file-name)
-    (delete-file file-name)))
-
- ((eqv? ch (key-f 9))
-  (setlocale LC_ALL "de_DE.UTF-8")
-  )
- 
- ((eqv? ch (key-f 10))
-  (let ((p (make-file-browser
-           page
-           (string-append (getenv "kbd_package") "/share/keymaps")
-           page-stack)))
-    (set! page-stack (cons p page-stack))
-    ((page-refresh p) p)))))
+  (cond
+   ((eqv? ch (key-f 1))
+    (endwin)
+    (let* ((p (mkstemp! (string-copy "/tmp/installer.XXXXXX")))
+           (file-name (port-filename p)))
+      (format p "echo '~a'\n" (gettext "Type \"exit\" to return to the GuixSD 
installer."))
+      (close p)
+      (system* "bash" "--rcfile" file-name)
+      (delete-file file-name)))
+
+   ((eqv? ch (key-f 9))
+    (setlocale LC_ALL "de_DE.UTF-8")
+    )
+
+   ((eqv? ch (key-f 10))
+    (match (which "loadkeys")
+      (#f #f)  ;; Do nothing if loadkeys is not found
+      (loadkeys-directory
+       (let* ((keymap-directory
+               (string-append (dirname loadkeys-directory) 
"/../share/keymaps"))
+              (p (make-file-browser
+                  page keymap-directory
+                  page-stack)))
+         (set! page-stack (cons p page-stack))
+         ((page-refresh p) p)))))))
 
 (define (main-page-key-handler page ch)
   (let ((main-menu (page-datum page 'menu)))



reply via email to

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