Message ID | YIU+rmMowFm3Gqrw@thinkpad-x230-luhui |
---|---|
State | Accepted |
Headers | show |
Series | [bug#47994] services: kmscon: Add xkb-layout and xkb-options fields. | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | fail | View Laminar job |
cbaines/issue | success | View issue |
luhui schreef op zo 25-04-2021 om 18:04 [+0800]: > +@item @code{xkb-layout} (default: @code{#f}) > +When true, this field be a string used for set keyboard layout used in Kmscon. > +See the @code{xkeyboard-config} package for valid layouts. > + > +@item @code{xkb-options} (default: @code{#f}) > +When true, this field be a string used for set keyboard layout options used in > +Kmscon. See the @code{xkeyboard-config} package for valid options. I looked in the guix manual for ideas how to formulate this clearer. The section ‘10.6 Keyboard layout’ (<https://guix.gnu.org/manual/en/html_node/Keyboard-Layout.html#Keyboard-Layout>) seems interesting, in particualr the "keyboard-layout" procedure from (gnu system keyboard). It seemed a nicer abstraction than just raw strings. An extract from the manual: Keyboard layouts are represented by records created by the ‘keyboard-layout’ procedure of ‘(gnu system keyboard)’. Following the X Keyboard extension (XKB), each layout has four attributes: a name (often a language code such as “fi” for Finnish or “jp” for Japanese), an optional variant name, an optional keyboard model name, and a possibly empty list of additional options. In most cases the layout name is all you care about. -- Scheme Procedure: keyboard-layout NAME [VARIANT] [#:model] [#:options '()] Return a new keyboard layout with the given NAME and VARIANT. NAME must be a string such as ‘"fr"’; VARIANT must be a string such as ‘"bepo"’ or ‘"nodeadkeys"’. See the ‘xkeyboard-config’ package for valid options. Here are a few examples: ;; The German QWERTZ layout. Here we assume a standard ;; "pc105" keyboard model. (keyboard-layout "de") ;; The bépo variant of the French layout. (keyboard-layout "fr" "bepo") Could this be used instead of raw strings? > +When true, this field be a string used for set keyboard layout used in Kmscon. When true, this field is a string representing the name of the keyboard layout. Suggested documentation (based on the xorg-configuration documentation): @item @code{keboard-layout} (default: @code{#f}) If this is false, Kmscon uses the default keyboard layout. Otherwise this must be a field is a ‘keyboard layout’ object specifying the keyboard layout to use for the console. *Note Keyboard Layout::, for more information on how to specify the keyboard layout. Greetings, Maxime.
diff --git a/doc/guix.texi b/doc/guix.texi index b9019d5550..e8007c3965 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -88,6 +88,7 @@ Copyright @copyright{} 2020 John Soo@* Copyright @copyright{} 2020 Jonathan Brielmaier@* Copyright @copyright{} 2020 Edgar Vincent@* Copyright @copyright{} 2021 Maxime Devos@* +Copyright @copyright{} 2021 lu hui@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -15254,6 +15255,14 @@ Font engine used in Kmscon. @item @code{font-size} (default: @code{12}) Font size used in Kmscon. +@item @code{xkb-layout} (default: @code{#f}) +When true, this field be a string used for set keyboard layout used in Kmscon. +See the @code{xkeyboard-config} package for valid layouts. + +@item @code{xkb-options} (default: @code{#f}) +When true, this field be a string used for set keyboard layout options used in +Kmscon. See the @code{xkeyboard-config} package for valid options. + @item @code{kmscon} (default: @var{kmscon}) The Kmscon package to use. diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 24b3ea785b..bee101ab29 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -14,6 +14,7 @@ ;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de> ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re> ;;; Copyright © 2021 qblade <qblade@protonmail.com> +;;; Copyright © 2021 luhui <luhuins@163.com> ;;; ;;; This file is part of GNU Guix. ;;; @@ -2313,7 +2314,11 @@ This service is not part of @var{%base-services}." (font-engine kmscon-configuration-font-engine (default "pango")) (font-size kmscon-configuration-font-size - (default 12))) + (default 12)) + (xkb-layout kmscon-configuration-xkb-layout + (default #f)) ;string | #f + (xkb-options kmscon-configuration-xkb-options + (default #f))) ;string | #f (define kmscon-service-type (shepherd-service-type @@ -2326,7 +2331,9 @@ This service is not part of @var{%base-services}." (auto-login (kmscon-configuration-auto-login config)) (hardware-acceleration? (kmscon-configuration-hardware-acceleration? config)) (font-engine (kmscon-configuration-font-engine config)) - (font-size (kmscon-configuration-font-size config))) + (font-size (kmscon-configuration-font-size config)) + (xkb-layout (kmscon-configuration-xkb-layout config)) + (xkb-options (kmscon-configuration-xkb-options config))) (define kmscon-command #~(list @@ -2335,6 +2342,8 @@ This service is not part of @var{%base-services}." "--no-switchvt" ;Prevent a switch to the virtual terminal. "--font-engine" #$font-engine "--font-size" #$(number->string font-size) + #$@(if xkb-layout (list "--xkb-layout" xkb-layout) '()) + #$@(if xkb-options (list "--xkb-options" xkb-options) '()) #$@(if hardware-acceleration? '("--hwaccel") '()) "--login" "--" #$login-program #$@login-arguments
ok, new patch: From 17c626839fb397e8c6f40d2855623f7181d0ab31 Mon Sep 17 00:00:00 2001 From: luhui <luhuins@163.com> Date: Sat, 24 Apr 2021 10:56:03 +0800 Subject: [PATCH] services: kmscon: Add xkb-layout and xkb-options fields. * gnu/services/base.scm (<kmscon-configuration>): Add xkb-layout and xkb-options fields. * doc/guix.texi (Base Services): Document them. --- doc/guix.texi | 9 +++++++++ gnu/services/base.scm | 13 +++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-)