From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id CHrfNM2xcWWRgQAA9RJhRA:P1 (envelope-from ) for ; Thu, 07 Dec 2023 12:51:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CHrfNM2xcWWRgQAA9RJhRA (envelope-from ) for ; Thu, 07 Dec 2023 12:51:41 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7BE2832A41 for ; Thu, 7 Dec 2023 12:51:41 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=ultrarare.space header.s=dkim header.b=jeBhpU3+; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=reject) header.from=ultrarare.space ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1701949901; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=aIPORNBEwwmzQKjmoZyXY5Je3UYDWsaL9denPfD9Hfc=; b=KGuAfSGjbg7wswI9dzLoqWFMJ77U3lRmX1pKwj0s1UPnx8iwe2UxB7VYZ9CY++358AjIh4 fnMLlkqIzKD6AoWPgBmtrFiVjeXENpHzGNzk3j2hwGJzDqpDlQe5l/AYnGGoWbD1YBO/h3 3BpmilOWzCeOknEIgien6UGqRfSNkob+Tz8SuX5B2eZmi+4ZstSXEvkRVxN+QNgDPAXGX+ UkWiKoDrMRv62j6KxIdflXbQ3D0dXsQEWMIzZOVuKYP1povA7ALjPRi/h0c4TlqFm9ZSUb B10w2MbdyQIQ1vrZ7hpO3Sn9Zcx97pgD47FZkyNnfecWb2I/Bg5ktR9o8x9RFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=ultrarare.space header.s=dkim header.b=jeBhpU3+; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=reject) header.from=ultrarare.space ARC-Seal: i=1; s=key1; d=yhetil.org; t=1701949901; a=rsa-sha256; cv=none; b=ZcLOiZhkZNxagcHGi3SAmoJpMa94vfaMPT73j0a7QeZ+RUmBpJV1MTy/WC78cTBH6vVlNE C/3roTEKhytgHQ2nhwv+csmmCQCJXoRsh0Fi8oNlofa4IRYlOf3OOFdH8sAacm/uH4M34o muwuzw8fKnzK05bTT0tZc/EQyAFiHLvS+CA7UB2MMrxCsgJPpqLUcq2g28/5TJw5biJ4p5 qHOJ2w3KVkhmFoIVcpotYVmt0SF59KwZ4L56f9oIfEchrgkifG8SoM2AK72/DkB39chMbt 6MflwZSp8GeSMqN8czi8n0mPaikmXABDjCK3pFKhIJgCzdvzSriUFRZdZPmPSQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBCuP-0003GO-1I; Thu, 07 Dec 2023 06:51:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBCuN-0003G8-Iw for help-guix@gnu.org; Thu, 07 Dec 2023 06:51:11 -0500 Received: from mail.boiledscript.com ([144.168.59.46]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBCuL-0002Jo-V1 for help-guix@gnu.org; Thu, 07 Dec 2023 06:51:11 -0500 Date: Thu, 07 Dec 2023 19:50:24 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1701949622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aIPORNBEwwmzQKjmoZyXY5Je3UYDWsaL9denPfD9Hfc=; b=jeBhpU3+Sof0ilO/1HRg95zWd27ngzwCwAFgGlkG+o7GzbpohAUEt7yr01hQp1g0O9E585 16Q4r7we/JdbesxnnNG4pkePnHYy12WkUFKd5GZlLTrnNv0X26IzUqj4IZnx9ynzGQaihX wwMNkM4B+ouI7HGdQrPjlN2WL2CfFS+5Q1K+KsMkohUbQo/mqYsB1+4wP4EcQh2tshEqJ6 206mARB6JX16h1ZylixL/U7qDyeNqGLZTvdYJM7TtuCIWXFM0pK8Sa1cHbeWYFCWPc+nk0 kdsB9Kpwl/DpD7nGfDfVzuGO0XsPw1hVAgfif7JxikXWg06uWEoj9+DbAcLvuQ== Message-ID: <87h6kudyf3.wl-hako@ultrarare.space> From: Hilton Chain To: Efraim Flashner Cc: Lars Rustand , help-guix@gnu.org Subject: Re: Keyboard layout options not working In-Reply-To: References: <871qbyl41o.fsf@yoga.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spamd-Bar: / Received-SPF: pass client-ip=144.168.59.46; envelope-from=hako@ultrarare.space; helo=mail.boiledscript.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.35 X-Spam-Score: -6.35 X-Migadu-Queue-Id: 7BE2832A41 X-Migadu-Scanner: mx12.migadu.com X-TUID: u+IurSnhWUQM 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 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 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 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