guix-commits
[Top][All Lists]
Advanced

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

03/04: services: localed: Do nothing for unconfigured keyboards.


From: guix-commits
Subject: 03/04: services: localed: Do nothing for unconfigured keyboards.
Date: Fri, 5 Apr 2019 11:55:57 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 1361584983b7e53f5eadd1815d1a2b81b387e6ad
Author: Ludovic Courtès <address@hidden>
Date:   Fri Apr 5 17:51:28 2019 +0200

    services: localed: Do nothing for unconfigured keyboards.
    
    * gnu/services/xorg.scm (localed-service-type)[package]: Return the
    empty list when the 'keyboard-layout' field is #f.
    [compose]: Use 'find' instead of 'first'.
---
 gnu/services/xorg.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index d0e6c7c..d4e73c1 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -707,7 +707,12 @@ makes the good ol' XlockMore usable."
       '()))
 
 (define localed-service-type
-  (let ((package (compose list localed-configuration-localed)))
+  (let ((package (lambda (config)
+                   ;; Don't bother if the user didn't specify any keyboard
+                   ;; layout.
+                   (if (localed-configuration-keyboard-layout config)
+                       (list (localed-configuration-localed config))
+                       '()))))
     (service-type (name 'localed)
                   (extensions
                    (list (service-extension dbus-root-service-type
@@ -720,7 +725,8 @@ makes the good ol' XlockMore usable."
 
                   ;; This service can be extended, typically by the X login
                   ;; manager, to communicate the chosen Xorg keyboard layout.
-                  (compose first)
+                  (compose (lambda (extensions)
+                             (find keyboard-layout? extensions)))
                   (extend (lambda (config keyboard-layout)
                             (localed-configuration
                              (inherit config)



reply via email to

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