Xorg/Keyboard configuration options is not persistent across reboot

Hello everyone,

I have recently installed the i3WM version of EOS. I am trying to use my caps lock key as my escape key. So I followed this arch wiki page (https://wiki.archlinux.org/title/Xorg/Keyboard_configuration#Using_X_configuration_files) and changed my /etc/X11/xorg.conf.d/00-keyboard.conf file to look like this,

# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us"
        Option "XkbOptions" "caps:swapescape"
EndSection

but after I reboot, my caps lock remains as caps lock! But it does work If I execute setxkbmap -option caps:swapescape.

What should I do to make the XkbOptions persistent across reboot? I do not just want to add the setxkbmap command to my bashrc.

Do you have any other files in /etc/X11/xorg.conf.d that may be resetting or overriding this conf file?

Look into ~/.config/i3/config.
Go to this line

# configure multiple keyboard layouts and hotkey to switch (Alt+CAPSLOCK in this example)
#exec --no-startup-id setxkbmap -layout 'us,sk' -variant altgr-intl,qwerty -option 'grp:alt_caps_toggle'

and set it up according to what you need.

nope I only have this one file.

I also looked at the /var/log/Xorg.0.log and I can see that this option is set at some point. but somehow it is not working. And I don’t have enough knowledge yet to understand from the logs what is messing it up later!.

thanks for your response.

I know I can do something like that but according to the arch wiki, if I change my 00-keyboard.conf, the changes should be persistent, but it is not working like that and I am more interested in resolving that.

I believe you would need to investigate systemd-localed.service.

man systemd-localed.service

1 Like

:point_up:

While it looks to me like your .conf file should work - maybe you should try using localectl to edit the .conf file?

localectl may be used instead of manually editing X configuration files. It will save the configuration in /etc/X11/xorg.conf.d/00-keyboard.conf , this file should not be manually edited, because localectl will overwrite the changes on next start.

localectl --no-convert set-x11-keymap us "" "" caps:swapescape

(The empty strings ("" “”) would be used to specify Model and Variant; if you are not specifying these, you need to use the empty quote marks as placeholders when you issue the command)

1 Like

I did try to use localectl before but that did not work. I tried both with the--no-convert option and without it. But it does not work. The only way I can change the keys is by using setxkbmap. And I am really confused by this!!!

1 Like

Me too :grin:.

that’s a good idea, but I thought an expert could solve it faster than me!! this is my very first time trying out a WM installation so I am mostly used to having things taken care of by my DE!!!

Now you have been given two different options to resolve this:
In i3 config or with localectl

PS- Is systemd-localed.service enabled?
I guess it should be… :thinking:

I think by default the locale service is enabled during startup and then disabled. This is what I am getting by running systemctl status systemd-localed.sevice

○ systemd-localed.service - Locale Service
     Loaded: loaded (/usr/lib/systemd/system/systemd-localed.service; static)
     Active: inactive (dead)
       Docs: man:systemd-localed.service(8)
             man:locale.conf(5)
             man:vconsole.conf(5)
             man:org.freedesktop.locale1(5)

Feb 18 16:11:04 friday systemd[1]: Starting Locale Service...
Feb 18 16:11:04 friday systemd[1]: Started Locale Service.
Feb 18 16:11:34 friday systemd[1]: systemd-localed.service: Deactivated successfully.

and I tried using localectl but that is not working

All I can think of is that there’s some config file in ~/. (hidden file) that’s resetting the keymap. I have never used i3 so I am not familiar with its configs, but that’s all I can think of.

okay, I will look through the hidden files to see if something is there. I thought I could see the logs to find out what is going on but I cannot comprehend it properly yet!

1 Like

I have not found in the ~/.config file that might cause this. Also in Xorg.0.log I see this,

[     7.438] (II) XINPUT: Adding extended input device "Integrated_Webcam_HD: Integrate" (type: KEYBOARD, id 17)
[     7.438] (**) Option "xkb_layout" "us"
[     7.438] (**) Option "xkb_options" "caps:swapescape"

and nothing changes it afterwards so what is going on?!!! and why is my integrated webcam is set as keyboard??!!

I just tried swapping the capslock and esc keys on a couple of my laptops using localctl (localectl --no-convert set-x11-keymap us "" "" caps:swapescape); it worked perfectly.

One was running KDE and the other LXDE, so again all I can think of is that this is specifically related to an i3wm configuration (I’m not saying that’s definitely what it is, it’s just the only thing that pops into my head). However, I have no experience with i3wm at all.

On the matter of the webcam - does the webcam work?

2 Likes

yeah, it works.

1 Like

Well, it is an input device :laughing:. It inputs images…

Apparently the system thinks it a keyboard, but if it’s working - no harm done?

Of course.

I am just wondering if anyone who uses i3wm has faced this issue before or not. When you try something from the arch wiki, you generally expect it to work. So is it because I messed something up or because the default configs of i3wm from EOS have some flaws?