unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guix-devel@gnu.org
Cc: 25453@debbugs.gnu.org
Subject: bug#25453: Keyboard layout configuration
Date: Sun, 13 Jan 2019 22:36:21 +0100	[thread overview]
Message-ID: <87won81bqi.fsf_-_@gnu.org> (raw)
In-Reply-To: <87imyss44u.fsf@dismail.de> (Joshua Branson's message of "Sun, 13 Jan 2019 15:18:25 -0500")

Hello Joshua,

Thanks a lot for working on this!  I’d 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
<https://issues.guix.info/issue/25453>.

Joshua Branson <jbranso@dismail.de> 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’s also the question of how to “translate” keyboard 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’s in ‘console-setup’, 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’d probably need to invoke ‘loadkeys’ 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’ll have to use ‘console-setup’.

The difficulty is that we want a single ‘keyboard-layout’ field (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’t 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’s done on Debian & co.

Thoughts?

Ludo’.

       reply	other threads:[~2019-01-13 21:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87bm4wwrku.fsf@dismail.de>
     [not found] ` <877efktnry.fsf@elephly.net>
     [not found]   ` <87imyss44u.fsf@dismail.de>
2019-01-13 21:36     ` Ludovic Courtès [this message]
2019-01-13 22:49       ` bug#25453: Keyboard layout configuration nee
     [not found]       ` <6ac13233-d351-6ce5-09a2-4eb91750364f@cock.li>
2019-01-15 22:21         ` Ludovic Courtès
2019-01-16 13:10         ` Ludovic Courtès
     [not found]         ` <874la9y323.fsf@gnu.org>
2019-03-12 19:34           ` Taylan Kammer
     [not found]           ` <871s3blweg.fsf@gmail.com>
2019-03-15 18:19             ` nee
2019-03-21 22:23               ` Taylan Kammer
2019-03-20 23:07           ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87won81bqi.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=25453@debbugs.gnu.org \
    --cc=guix-devel@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).