Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] setting dvorak keyboard layout in GDM with openRC
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Schievel
n00b
n00b


Joined: 13 Sep 2021
Posts: 27

PostPosted: Mon Sep 13, 2021 7:22 pm    Post subject: [SOLVED] setting dvorak keyboard layout in GDM with openRC Reply with quote

Hi,

I am quite new to Gentoo and openrc, so please forgive me a stupid question.

It seems like those guys at the Gnome project have some issues with keyboard layouts in GDM. They also messed with the menue where you can set them an this menue is gone for now. You can only set the users keymap in gnomes settings, but not the keymap in GDM, which is system wide, since no user is logged in when GDM shows up.

Anyway, so I found this solution where you can run
Code:
localectl set-x11-keymap us,us "" dvorak,

and it will give you back the options to choose the layout with a dropdown menue in the top right corner. I tried this on my manjaro install (with systemd of course) and it works.

Since I don't have systemd on my gentoo installation but rather openrc I wonder how to set this in openrc.
What localectl effectively does (apart from some other things probably) is changing the file /etc/X11/xorg.conf.d/00-keyboard.conf and putting something in there like
Code:
 Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us,us"
   Option "XkbVariant" "dvorak,"
EndSection


But this file does not exist for me. I also tried creating this file in /etc/X11/xinit/xinitrc.d/30-keyboard.conf with the same contents, but no luck.

I would also be happy to just default this to dvorak with a command in some init-script of X, but I dont know which command (setxkbmap probably, but I tried it and it does nothing) and i dont know which script.

Would be great if you could help me.

Rgds


Last edited by Schievel on Tue Oct 12, 2021 7:59 am; edited 1 time in total
Back to top
View user's profile Send private message
Schievel
n00b
n00b


Joined: 13 Sep 2021
Posts: 27

PostPosted: Mon Oct 11, 2021 2:12 pm    Post subject: Reply with quote

I finally got this to work.

The irritating thing is, that there is a /usr/share/xorg.conf.d directory in a fresh X installation in Gentoo with OpenRC, but the setting must be done in the /etc/X11/xorg.conf.d directory.
Making a setting in the config file /etc/X11/xorg.conf does not do a thing, although I thought xorg.conf and xorg.conf.d are actually the same thing.
So this as all a bit weird and disturbing, but I got it to work by runnig localectl on a different install with systemd on it and watching closely what exactly it changes.

Anyway, so if the directory /etc/X11/xorg.conf.d does not exist, then create it. And put file named 00-keyboard.conf in there with the following content:

Code:
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us,us"
        Option "XkbModel" "“”"
        Option "XkbVariant" "dvorak,"
EndSection


I know the line with the model is weird, but this is what systemd-localed does. I am not sure if its necessary, but since all this is bordering to voodoo, I better leave it in.

Hope this helps some fellow. I will also update the wiki later.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54216
Location: 56N 3W

PostPosted: Mon Oct 11, 2021 2:24 pm    Post subject: Reply with quote

Schievel,

xorg.conf and xorg.conf.d/* are concatenated together and whatever comes of of that is used, so settings in one file can override settings in another.
Oh, I'm a dvorak-uk user. :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Schievel
n00b
n00b


Joined: 13 Sep 2021
Posts: 27

PostPosted: Mon Oct 11, 2021 8:25 pm    Post subject: Reply with quote

Yes in know, but why is there a /usr/share/xorg.conf.d directory, that does nothing?
And why did changing the settings in the file /etc/X11/xorg.conf nothing?

Also the settings with us and dvorak always worked fine for me in Gnome after I logged in, they must be stored somewhere else in gnome. (dconf maybe or whatever) Gnome needs settings in xorg.conf or xorc.conf.d resp. solely in gdm.

// apparently the /usr/share/xorg.conf.d files are default config files.

Anyway, during my research I found I am definitely not the only one online that has this problem. So maybe this thread is going to help somebody, especially since gnome removed the keyboard settings for gdm from the gnome-control-center when they reworked the user accounts page.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54216
Location: 56N 3W

PostPosted: Tue Oct 12, 2021 8:01 am    Post subject: Reply with quote

Schievel,

Both work but depending on the order that all the bits are concatenated, you can set something in one file and unset it in another.

With two
Code:
Section "InputClass"
        Identifier ...
        MatchIsKeyboard "on"
EndSection

only the last one take effect. I don't think that the Identifier matters unless its used somewhere else.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum