Xkboptions not effective after login

I prefer to swap caps lock as control key, as it better suites my requirement. I used localectl to add ''ctrl:swapcaps" to xkboptions. But, its only effective on the Login screen. After that, it seems to revert back to normal setup(without key swap).

Output of /etc/X11/xorg.conf.d/00-keyboard.conf:

[ruthra@localhost xorg.conf.d]$ cat 00-keyboard.conf 
# 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" "ctrl:swapcaps"
EndSection

Which Desktop Environment?

does /usr/bin/setxkbmap -option "caps:swapescape" work after you’ve logged in?

If you’re running Gnome you could give gnome-tweaks a go.
sudo dnf install gnome-tweaks
Run gnome tweaks, go to keyboard & mouse additional layout options
or
gsettings set org.gnome.desktop.input-sources xkb-options '["caps:ctrl_modifier"]'

Thanks

Which Desktop Environment?

Gnome. Its a fresh install of Fedora 33. One thing i want to point out, the same xkboption works on another machine that runs Fedora 33 that was upgraded from 32.

/usr/bin/setxkbmap -option “caps:swapescape”

It appears that this config doesn’t survive a session.

[ruthra@localhost ~] /usr/bin/setxkbmap -option "caps:swapescape" [ruthra@localhost ~] /usr/bin/setxkbmap -print -v 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev…
Trying to load rules file /usr/share/X11/xkb/rules/evdev…
Success.
Applied rules from evdev:
rules: evdev
model: pc105
layout: us
options: caps:swapescape
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(evdev)+capslock(swapescape)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include “evdev+aliases(qwerty)” };
xkb_types { include “complete” };
xkb_compat { include “complete” };
xkb_symbols { include “pc+us+inet(evdev)+capslock(swapescape)” };
xkb_geometry { include “pc(pc105)” };
};

Logged off. Key swap is ineffective on the login screen itself (tried rebooting as well with same results).

After login:

[ruthra@localhost ~]$ /usr/bin/setxkbmap -print -v 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev…
Trying to load rules file /usr/share/X11/xkb/rules/evdev…
Success.
Applied rules from evdev:
rules: evdev
model: pc105
layout: us
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(evdev)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include “evdev+aliases(qwerty)” };
xkb_types { include “complete” };
xkb_compat { include “complete” };
xkb_symbols { include “pc+us+inet(evdev)” };
xkb_geometry { include “pc(pc105)” };
};

So, I used localectl to set this option in /etc/X11/xorg.conf.d/00-keyboard.conf. Similar behaviour to swapcaps, only works on Login screen.

gsettings set org.gnome.desktop.input-sources xkb-options ‘[“caps:ctrl_modifier”]’

This too is not working.

Yet to try the gnome-tweaks tool.

gnome-tweaks config is effective even after login.

@grumpey Thanks for your help.

1 Like