Hello, I’m new to nixos and linux in general. I use budgie desktop and I tried to make a shortcut to switch keyboard layout on LShift + LAlt. I made it with both configuration.nix and budgie settings, but it works kinda strange. Instead of switching languages while I press both LShift and LAlt it requires me to first press LAlt and while holding it press LShift. On keyboard layout preview that budgie desktop is provided with I noticed that LShift and LAlt don’t register while pressed together, unlike other keys. Also while I’m on login screen (I use lightdm) everything works correctly, the way I declared in configuration.nix with xkb.options, so the problem seems to be in desktop manager. How can it be fixed?
Hello
How have you declared this shortcut?
Can you post your config?
I declared it by:
services.xserver.xkb = {
layout = "us,ru";
options = "grp:lalt_lshift_toggle";
};
I know that gnome-settings-daemon that Budgie uses replaces config settings, so I entered:
gsettings reset org.gnome.desktop.input-sources xkb-options
gsettings reset org.gnome.desktop.input-sources sources
and it actually worked for input sources, but not for shortcuts.
Just for clarification, your issue is that you need to press LAlt and the LShift to switch layouts, but you want that you first press Lshift and then Lalt?
If so try:
services.xserver.xkb = {
layout = "us,ru";
options = "grp:lshift_lalt_toggle";
};
No, it requires me to press first LAlt then LShift, but I wanted it to work as any other shortcut, by pressing both LAlt and LShift simultaneously. Actually editing config file doesn’t change anything in desktop manager, it only works in display manager on login screen.
Ok. It only works in the display manager. Are you running budgie on wayland or X?
Also can you switch layouts with the builtin budgie settings:
I use X, and yeah, it does work with builtin setting, but as I mentioned, it requires to press buttons one by one and not together as it should.
I think the issue is, that budgie is interfering with your X configuration.
Can you first try to restart the necessary dconf settings with following:
gsettings reset org.gnome.desktop.input-sources xkb-options
gsettings reset org.gnome.desktop.input-sources sources
After that try putting this in your config.
services.xserver.displayManager.sessionCommands = ''
setxkbmap -layout us,ru -option grp:lalt_lshift_toggle
'';
This should force every X session to use the config.
If that does not work, maybe try it just by using dconf and not xkb config.
Ether by running this command:
gsettings set org.gnome.desktop.input-sources xkb-options "['grp:lalt_lshift_toggle']"
Or if you are using home-manager:
dconf.settings = {
"org/gnome/desktop/input-sources" = {
xkb-options = [ "grp:lalt_lshift_toggle" ];
};
};
Forcing desktop to use the config was enough, it works properly at last. Thanks!