Skip to content

Adding keyboard layout to GDM in control center not possible

I have had a problem that has come and gone over the years when I install Gnome + GDM on Arch: I can't add or change the keyboard layout in GDM the 'normal' way. It's like the Gnome installation don't recognize that GDM exists. When I'm using Fedora, this can be done through the gnome-control-center. I (mysteriously) got this to work one time when installing Gnome on Arch, but have no idea what I did differently during the install process.

I use colemak and constantly write my login password wrong every time I start my machine, because it defaults to qwerty – which is mildly annoying. Someone else having this problem, and can someone point me in the right direction to solve this?

2 points10 comments
Open on Reddit
About this post
Posted
Archived
Score
2 · 100% up
Kind
Text
ID
75impw

Author

3
posts
25
comments
0
media
View profile

11 comments

May you need to edit ~/.dmrc file, like this:

[Desktop]

Language=de_DE.UTF-8   # change to your default lang

Layout=de   nodeadkeys # change to your keyboard layout
1 points

According to the wiki, this method is for the legacy GDM (2.0). Usually there is a keyboard layout changer in the upper right corner of the GDM login screen, when multiple layouts are selected trough the control center.

1 points

I don't know how to fix the missing stuff in gnome-control-center. I would try to reinstall the gdm package. You could first remove the home directory of the gdm user account. Installing the package should create a new one. That home directory is normally /var/lib/gdm. You can check by running the following at the command line:

echo ~gdm

About how to fix the keyboard for gdm without gnome-control-center, if you use Xorg, you can set the system default using localectl. This localectl tool will create an Xorg config file /etc/X11/xorg.conf.d/00-keyboard.conf.

Looking through things here, I think you are supposed to set Colemak for a US keyboard like this:

localectl set-x11-keymap us '' colemak

You can research that stuff like so:

localectl
localectl --help
localectl list-x11-keymap-layouts
localectl list-x11-keymap-variants us
localectl list-x11-keymap-options us

This localectl can btw. also configure the console keymap if you didn't yet do that and want to do it as well. I can see a "colemak" line in the output of "localectl list-keymaps".

If you are using Wayland and not X, things work differently and I think the localectl tool will do nothing.

About how to try to set the keyboard manually for Gnome+Wayland, I found out that you can log into the gdm user account like this:

machinectl shell gdm@

You can browse Gnome's settings like so:

gsettings list-recursively | less

You can also try to hunt down the setting that's about the keyboard layout with grep. I think it's this one here:

$ gsettings list-recursively | grep input
...
org.gnome.desktop.input-sources sources [('xkb', 'us+altgr-intl')]
...

Next, you would try to set what you see in your user account for the gdm user account. For my example here, it seems changing that entry in gsettings can be done like this:

gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+altgr-intl')]"

I don't know if this works, but it's at least not printing an error when I run it.

If you break something, you should be able to fix things by deleting the home of the gdm user and recreating it by reinstalling the gdm package.

1 points

Wow, thanks for this really detailed answer! I tried deleting /var/lib/gdm and reinstalling it, but it did not help. I am pretty sure both GDM and Gnome run on Wayland as default. I think GDM transitioned first, ang Gnome followed later. Why do you think localectl wouldn't work when using Wayland? Are you sure it is X only?

What I find really strange is that the option for adding more languages / layouts to GDM is not available in the gnome-control-center, as it is in other distros. My hypothesis is that it is caused by a "disconnect" between the Gnome installation and GDM somehow. Maybe this is caused by the install order of GDM in the gnome package? Another theory of mine is that the initial setup wizard needs to be installed separately in Arch, and is default in Fedora, and that this is a missing link.

1 points

I heard that for Wayland, each desktop has to do its own thing for a lot of stuff that was previously the job of X. With X, the desktops are all asking the X server for what's up with the keyboard and the monitors and such, and the localectl is writing that X config file I mentioned.

I'm guessing the localectl tool does not know about all the different Wayland window managers that might be out there. I don't know if it maybe does know about config files of something big like Gnome.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.