From: Hilton Chain <hako@ultrarare.space>
To: Efraim Flashner <efraim@flashner.co.il>
Cc: Lars Rustand <rustand.lars@gmail.com>, help-guix@gnu.org
Subject: Re: Keyboard layout options not working
Date: Thu, 07 Dec 2023 19:50:24 +0800 [thread overview]
Message-ID: <87h6kudyf3.wl-hako@ultrarare.space> (raw)
In-Reply-To: <ZXGeZcClpbvijEp-@3900XT>
Hi Efraim and Lars,
On Thu, 07 Dec 2023 18:28:53 +0800,
Efraim Flashner wrote:
>
> On Thu, Dec 07, 2023 at 10:48:11AM +0100, Lars Rustand wrote:
> > Hello, I'm trying to set the keyboard-layout options in my system config. I
> > have set the following:
> >
> > -8<---------------cut here---------------start------------->8---
> > (keyboard-layout (keyboard-layout "us,no" #:options '("grp:switch")))
> > -8<---------------cut here---------------end--------------->8---
In (gnu system keyboard), keyboard-layout is defined as:
--8<---------------cut here---------------start------------->8---
(keyboard-layout name (variant) (#:model) (#:options))
--8<---------------cut here---------------end--------------->8---
So the following should be used instead:
--8<---------------cut here---------------start------------->8---
(keyboard-layout "us" "no" #:options '("grp:switch"))
--8<---------------cut here---------------end--------------->8---
For TTY usage, the <keyboard-layout> record is used to create a console keymap
via ckbcomp, which has a different syntax from setxkbmap and requires a space
between layout and variant.
> > The above seems to have no effect. However, the same option works fine
> > when used with setxkbmap like this:
> >
> > -8<---------------cut here---------------start------------->8---
> > setxkbmap us,no -option 'grp:switch'
> > -8<---------------cut here---------------end--------------->8---
> >
> > It also works fine if set in `/etc/X11/xorg.conf.d/00-keyboard.conf`
> > like this:
> >
> > -8<---------------cut here---------------start------------->8---
> > Section "InputClass"
> > Identifier "system-keyboard"
> > MatchIsKeyboard "on"
> > Option "XkbLayout" "us,no"
> > Option "XkbOptions" "grp:switch"
> > EndSection
> > -8<---------------cut here---------------end--------------->8---
>
> I wouldn't mind getting the answer to this too.
>
> I have my keyboard config set in my os-config and also in my
> sway-config. IIRC the keyboard-layout works really well in a TTY but
> not always as well on the desktop.
And for X, xorg-configuration accepts a <keyboard-layout> record and sets option
XkbLayout to the name field of that record and XkbVariant to variant (only when
it's present). Since XkbLayout recognizes the comma syntax and variant is not
set, the result is valid.
So support for <keyboard-layout> is really environment-specific... But for sway
there's a procedure in rde[1] to create an input configuration as an alist, I
think it can be adapted to create a string as well (I personally use a
mixed-text-file for my sway config[2]).
Thanks
---
[1]: https://git.sr.ht/~abcdw/rde/tree/master/item/src/rde/features/wm.scm#L94
[2]: https://github.com/rakino/Testament/blob/trunk/dorphine-home.scm#L129
next prev parent reply other threads:[~2023-12-07 11:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 9:48 Keyboard layout options not working Lars Rustand
2023-12-07 10:28 ` Efraim Flashner
2023-12-07 11:50 ` Hilton Chain [this message]
2023-12-07 12:28 ` Lars Rustand
2023-12-07 12:53 ` Lars Rustand
2023-12-07 13:46 ` Hilton Chain
2023-12-07 20:17 ` Lars Rustand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h6kudyf3.wl-hako@ultrarare.space \
--to=hako@ultrarare.space \
--cc=efraim@flashner.co.il \
--cc=help-guix@gnu.org \
--cc=rustand.lars@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.