Not sure if it is true for GNOME Flashback, but regular GNOME uses gnome-settings-daemon to manage keyboard configuration. And its keyboard manager uses GSettings to store the keyboard configuration, only using the xkb config for initial set up:
Thanks, that indeed fixed the problem! I think that I somehow made it work on my previous linux installation, because I worked with Gnome+i3 before, but this is exactly the problem with other distros - you set something up by hand somewhere and then you forget about it.
I’m having the same issue with “none+i3”.
Possibly related, sway also has a keyboard issue since this started
and i think i18n.consoleKeymap moved to console.keyMap around the same time (the TTY’s are correctly set to dvorak)
That is a completely different issue, unless you use gnome-settings-Daemon. I think dvorak, or maybe even us should be in xkbVariant option. And I heard xkbOptions should not contain white space.
i don’t have anything gnome set up setxkbmap dvorak works for me
my configuration as is (minus the i18n change and maybe the services.xserver.displayManager.defaultSession change) used to work
i’ll try adding services.xserver.xkbVariant and removing the whitespace
though combined with the similar timing, i don’t believe this to be a different issue
oh and the first time it presented itself (after a reboot) it went away ~10m after login
This issue is only relevant to gnome-settings-daemon and is not new – it has always been there and it will continue to be present until we implement #54150.
If I have a brand new install of NixOS with Gnome Desktop, and I have not modified any dconf settings, should the services.xserver.xkbOptions work? Or do I need to delete that stuff from dconf regardless?
Unfortunately, we only have way to set default GSettings values but since gnome-settings-daemon sets the value to one from xkb-config, the default value will not be used:
services.xserver.desktopManager.gnome3 = {
extraGSettingsOverridePackages = with pkgs; [ gnome3.gnome-settings-daemon ];
extraGSettingsOverrides = ''
# does not work
[org.gnome.desktop.input-sources]
sources=[('xkb', '${config.services.xserver.layout}${lib.optionalString (config.services.xserver.xkbVariant != "") "+" + config.services.xserver.xkbVariant}')]
xkb-options=['${config.services.xserver.xkbOptions}']
'';
};
Last question: do I run the gsettings commands with sudo or no?
EDIT:
I just ran the gsettings commands with and without sudo, then it disabled my capslock-as-control setting that I set with tweak tool (good so far, so my capslock key became back to being a capslock key).
Then, I logged out and back in, and my capslock key went back to being control (so far, I thought it was working, yaaaay).
Then I went and checked inside of Gnome tweak tool, and apparently the setting for swapping control with capslock was re-enabled again.
So it seems tweak tool setting is coming back. I tried disabling that setting manually, log out/in, but that setting keeps coming back.
Then I tried logging into Gnome as root, and in that case ctrl is ctrl and caps is caps, which is not what I expected. If the xkbOptions is system-wide, then I thought that when I logged in as root I would have the caps swapped with control, but that wasn’t the case.
So it seems that the option is still not working. Any ideas? Is gnome-tweak-tool giving me false positives because it keeps setting the option within the tool? Any idea why it does not work for root?
Well, as I wrote, gnome-settings-daemon will check if /org/gnome/desktop/input-sources/xkb-options setting is set and if not, it will set it from the value stored by the services.xserver.xkbOptions in /etc/X11/xorg.conf.d/00-keyboard.conf. GNOME Tweaks just show the value of /org/gnome/desktop/input-sources/xkb-options.
Not sure what you mean but the GSetting is the only thing relevant for GNOME after log-in. You can check the value directly using:
gsettings get org.gnome.desktop.input-sources xkb-options
I think sudo gsettings might not work because it would still see your dconf database instead of root’s. If you logged to root before it would still have the setting from the previous login.
It should not really set anything unless you click something. But you will still see the settings set by gnome-settings-daemon.
You’re right! Instead of running gsettings with sudo while logged in as normal user, I ran sudo -i then rm -rf ~/.config/dconf, and then after logging in with root it worked as expected.
I’m thinking that maybe it’ll be better to do this stuff at the system level, as in for it to work even in the virtual terminals outside of X11.