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

From: luhui <[email-masked]>
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
...