From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#25453: Keyboard layout configuration Date: Sun, 13 Jan 2019 22:36:21 +0100 Message-ID: <87won81bqi.fsf_-_@gnu.org> References: <87bm4wwrku.fsf@dismail.de> <877efktnry.fsf@elephly.net> <87imyss44u.fsf@dismail.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:57248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ginRH-0002gA-E4 for bug-guix@gnu.org; Sun, 13 Jan 2019 16:37:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ginRG-0007s1-9R for bug-guix@gnu.org; Sun, 13 Jan 2019 16:37:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58843) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ginRG-0007rn-61 for bug-guix@gnu.org; Sun, 13 Jan 2019 16:37:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ginRF-00084s-NX for bug-guix@gnu.org; Sun, 13 Jan 2019 16:37:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87imyss44u.fsf@dismail.de> (Joshua Branson's message of "Sun, 13 Jan 2019 15:18:25 -0500") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: guix-devel@gnu.org Cc: 25453@debbugs.gnu.org Hello Joshua, Thanks a lot for working on this! I=E2=80=99d really like 1.0 to provide a reasonable way to configure the keyboard layout once and for all. I suggest we continue the discussion in the context of . Joshua Branson skribis: > I believe I have identified conceptually how to do some of these things. > > This project breaks down into four areas > > Getting the layout to work with: > > 1) grub > 2) linux's initrd > 3) console > 4) X/wayland's layout > 5) How to do the above There=E2=80=99s also the question of how to =E2=80=9Ctranslate=E2=80=9D key= board layouts among all of these. Debian has a mechanism whereby you specify the layout in a single place, and it then does the right thing for GRUB, Linux, X, and so on. I forgot how it works, but we should aim for something like that. > 1) I was not able to get grub to generate an alternate keyboard layout. > > #+BEGIN_SRC sh :results output :exports both > sudo grub-kbdcomp -o /boot/grub/dvorak.gkb dvorak > #+END_SRC > > #+RESULTS: > : /home/joshua/.guix-profile/bin/grub-kbdcomp: line 76: ckbcomp: command = not found > : ERROR: no valid keyboard layout found. Check the input. > > Do we have ckbcomp installed? How do I install that? I searched on packages.debian.org, and it=E2=80=99s in =E2=80=98console-set= up=E2=80=99, which happens to be the thing I was mentioning above: :-) https://packages.debian.org/stretch/console-setup It looks like Debian is actually upstream for this package, but it may be usable on non-Debian systems as well. > 2) Linux's initrd We=E2=80=99d probably need to invoke =E2=80=98loadkeys=E2=80=99 or similar = from the initrd, and to embed only the specific layout files that we need. See (gnu system linux-initrd). > 3) console > This shouldn't be all that hard to do. We just have to add a > console-keymap-service. Yes, #2 and #3 are actually the same thing (and redundant), except that in #2 we have to be careful not to embed too much in the initrd. > 4) X/Wayland's layout shouldn't be all that hard to do too. X is just > a simple xorg-start-command tweak. I'm not certain how to do the same > for wayland yet. OK. > 5) Now, how do I go about doing the above? I thought about modifying > %base-services and %desktop services, but some users won't use those > variables. So I am going to have to do some change at a deeper level. > I believe that I found the reconfigure module in the guix source code, > and I see the variable called "operating-system-user-services". My > intent is to modify this variable, and that should be how a good-old > reconfigure will change your layout. I think we=E2=80=99ll have to use =E2=80=98console-setup=E2=80=99. The difficulty is that we want a single =E2=80=98keyboard-layout=E2=80=99 f= ield (say) in the OS config that would have an effect on GRUB, the Linux console, Xorg, and Wayland, *if* they are used (setting the keyboard layout shouldn=E2=80=99t require you to use Xorg, for instance.) So I think we cannot use the standard Guix-y static approach where services are instantiated directly with the right configuration. Instead, Xorg & co. may need to look for a config file at a fixed location, say /etc/guix/keyboard-layout.conf, pretty much the same way it=E2=80=99s done on Debian & co. Thoughts? Ludo=E2=80=99.