GNU bug report logs - #47994
[PATCH] services: kmscon: Add xkb-layout and xkb-options fields.

Previous Next

Package: guix-patches;

Reported by: luhui <luhuins <at> 163.com>

Date: Sat, 24 Apr 2021 15:56:02 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 47994 in the body.
You can then email your comments to 47994 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#47994; Package guix-patches. (Sat, 24 Apr 2021 15:56:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to luhui <luhuins <at> 163.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 24 Apr 2021 15:56:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: luhui <luhuins <at> 163.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: kmscon: Add xkb-layout and xkb-options fields.
Date: Sat, 24 Apr 2021 13:37:25 +0800
[Message part 1 (text/plain, inline)]
Added xkb-layout and xkb-options fields to adjust the keyboard layout of kmscon

[0001-services-kmscon-Add-xkb-layout-and-xkb-options-field.patch (text/plain, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#47994; Package guix-patches. (Sun, 25 Apr 2021 09:13:02 GMT) Full text and rfc822 format available.

Message #8 received at 47994 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: luhui <luhuins <at> 163.com>, 47994 <at> debbugs.gnu.org
Subject: Re: [bug#47994] [PATCH] services: kmscon: Add xkb-layout and
 xkb-options fields.
Date: Sun, 25 Apr 2021 11:12:10 +0200
[Message part 1 (text/plain, inline)]
luhui schreef op za 24-04-2021 om 13:37 [+0800]:

> @item @code{xkb-layout} (default: @code{#f})
> Keyboard layout used in Kmscon.

What is the default here, is this a package object, a file-like object,
a string, where can I find a list of keyboard layouts ... please document!

> @item @code{xkb-options} (default: @code{#f})
> Keyboard layout options used in Kmscon.

What are the possible options, is this a list, a string, a list of strings, ...
please document!

> Signed-off-by: luhui <luhuins <at> 163.com>

Guix uses Signed-off-by differently from LKML.  IIUC, Signed-off-by is used when committing
on behalf of someone else, and is added by the committer.  The line would be something like

  Signed-off-by: Some Guix Committer <mail <at> example.org>

As you added a few things to doc/guix.texi and gnu/services/base.scm, you
can add a copyright line there.

Otherwise, I don't see any obvious problems, but I haven't tested.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47994; Package guix-patches. (Sun, 25 Apr 2021 10:05:01 GMT) Full text and rfc822 format available.

Message #11 received at 47994 <at> debbugs.gnu.org (full text, mbox):

From: luhui <luhuins <at> 163.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 47994 <at> debbugs.gnu.org, luhui <luhuins <at> 163.com>
Subject: Re: [bug#47994] [PATCH] services: kmscon: Add xkb-layout and
 xkb-options fields.
Date: Sun, 25 Apr 2021 18:04:30 +0800
[Message part 1 (text/plain, inline)]
ok, new patch:
[0001-services-kmscon-Add-xkb-layout-and-xkb-options-field.patch (text/plain, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#47994; Package guix-patches. (Sun, 25 Apr 2021 12:47:01 GMT) Full text and rfc822 format available.

Message #14 received at 47994 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: luhui <luhuins <at> 163.com>
Cc: 47994 <at> debbugs.gnu.org
Subject: Re: [bug#47994] [PATCH] services: kmscon: Add xkb-layout and
 xkb-options fields.
Date: Sun, 25 Apr 2021 14:46:25 +0200
[Message part 1 (text/plain, inline)]
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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47994; Package guix-patches. (Mon, 26 Apr 2021 02:08:02 GMT) Full text and rfc822 format available.

Message #17 received at 47994 <at> debbugs.gnu.org (full text, mbox):

From: luhui <luhuins <at> 163.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 47994 <at> debbugs.gnu.org, luhui <luhuins <at> 163.com>
Subject: Re: [bug#47994] [PATCH] services: kmscon: Add xkb-layout and
 xkb-options fields.
Date: Mon, 26 Apr 2021 10:07:03 +0800
[Message part 1 (text/plain, inline)]
OK,Re-written the code according to your suggestion.

new patch:

[0001-services-kmscon-Add-keyboard-layout-fields.patch (text/plain, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#47994; Package guix-patches. (Mon, 26 Apr 2021 19:24:02 GMT) Full text and rfc822 format available.

Message #20 received at 47994 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: luhui <luhuins <at> 163.com>
Cc: 47994 <at> debbugs.gnu.org
Subject: Re: [bug#47994] [PATCH] services: kmscon: Add xkb-layout and
 xkb-options fields.
Date: Mon, 26 Apr 2021 21:23:00 +0200
[Message part 1 (text/plain, inline)]
luhui schreef op ma 26-04-2021 om 10:07 [+0800]:
> OK,Re-written the code according to your suggestion.
> 
> new patch:

The new patch looks good to me, but I haven't tested it.

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#47994; Package guix-patches. (Tue, 04 May 2021 11:33:02 GMT) Full text and rfc822 format available.

Message #23 received at 47994 <at> debbugs.gnu.org (full text, mbox):

From: luhui <luhuins <at> 163.com>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 47994 <at> debbugs.gnu.org, luhui <luhuins <at> 163.com>
Subject: Re: [bug#47994] [PATCH] services: kmscon: Add xkb-layout and
 xkb-options fields.
Date: Tue, 4 May 2021 19:32:49 +0800
On Mon, Apr 26, 2021 at 09:23:00PM +0200, Maxime Devos wrote:
> luhui schreef op ma 26-04-2021 om 10:07 [+0800]:
> > OK,Re-written the code according to your suggestion.
> > 
> > new patch:
> 
> The new patch looks good to me, but I haven't tested it.


write it in a vm configuration

test code:

#+BEGIN_SRC scheme

;; need delete getty service (tty3,tty4,tty5,tty6)

(dbus-service)
(syslog-service)
;; default
(service kmscon-service-type
 (kmscon-configuration
  (virtual-terminal "tty3")))
;; us
(service kmscon-service-type
 (kmscon-configuration
  (virtual-terminal "tty4")
   (keyboard-layout (keyboard-layout "us"))))
;; us with ctrl:nocaps options
(service kmscon-service-type
 (kmscon-configuration
  (virtual-terminal "tty5")
   (keyboard-layout
    (keyboard-layout "us" #:options '("ctrl:nocaps")))))
;; with all args
(service kmscon-service-type
 (kmscon-configuration
  (virtual-terminal "tty6")
   (keyboard-layout
    (keyboard-layout "us" "intl" #:model "macbook78" #:options
     '("ctrl:nocaps" "compose:menu")))))

#+END_SRC

then

guix system vm vm-configuration.scm

xxxxxxxxxx-vm.sh # need graphic 

in vm:

herd status # ensure services is running

# test
Ctrl + Alt + F3 # ensure it is us keyboard layout
Ctrl + Alt + F4 # ensure it is us keyboard layout
Ctrl + Alt + F5 # ensure Caps Locks is Ctrl
...







Information forwarded to guix-patches <at> gnu.org:
bug#47994; Package guix-patches. (Fri, 04 Jun 2021 12:41:02 GMT) Full text and rfc822 format available.

Message #26 received at 47994 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: luhui <luhuins <at> 163.com>
Cc: 47994 <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#47994: [PATCH] services: kmscon: Add xkb-layout and
 xkb-options fields.
Date: Fri, 04 Jun 2021 14:40:21 +0200
Hello,

> +                       ,@(if variant `("--xkb-layout" ,variant) '())

This is supposed to be "--xkb-variant" here, right?

Otherwise, it looks good to me.

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#47994; Package guix-patches. (Mon, 21 Jun 2021 15:28:01 GMT) Full text and rfc822 format available.

Message #29 received at 47994 <at> debbugs.gnu.org (full text, mbox):

From: luhui <luhuins <at> 163.com>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 47994 <at> debbugs.gnu.org, luhui <luhuins <at> 163.com>,
 Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#47994: [PATCH] services: kmscon: Add xkb-layout and
 xkb-options fields.
Date: Mon, 21 Jun 2021 23:28:34 +0800
[Message part 1 (text/plain, inline)]
On Fri, Jun 04, 2021 at 02:40:21PM +0200, Mathieu Othacehe wrote:
> 
> Hello,
> 
> > +                       ,@(if variant `("--xkb-layout" ,variant) '())
> 
> This is supposed to be "--xkb-variant" here, right?

Sorry, made this mistake, now I fixed it and sent a new patch.

> 
> Otherwise, it looks good to me.
> 
> Thanks,
> 
> Mathieu
[0001-services-kmscon-Add-keyboard-layout-fields.patch (text/plain, attachment)]

Reply sent to Mathieu Othacehe <othacehe <at> gnu.org>:
You have taken responsibility. (Tue, 29 Jun 2021 17:03:01 GMT) Full text and rfc822 format available.

Notification sent to luhui <luhuins <at> 163.com>:
bug acknowledged by developer. (Tue, 29 Jun 2021 17:03:01 GMT) Full text and rfc822 format available.

Message #34 received at 47994-done <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: luhui <luhuins <at> 163.com>
Cc: 47994-done <at> debbugs.gnu.org, Maxime Devos <maximedevos <at> telenet.be>
Subject: Re: bug#47994: [PATCH] services: kmscon: Add xkb-layout and
 xkb-options fields.
Date: Tue, 29 Jun 2021 19:02:09 +0200
Hey,

> Sorry, made this mistake, now I fixed it and sent a new patch.

Pushed with minor edits,

Thanks,

Mathieu




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Jul 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.