Correct setting of input language

Hi,
I recently switched to i3. I used gnome before, I removed the best I could, changed to lightdm, lightdm greeter, picom and generally tried to switch as fully as I could figure.
I have a problem with keyboard. I was trying to set keyboard to US (for terminal) and my own language. I installed gxkb but as far as I can tell that’s just a tray notification which is great but needed to switch also.
I found the command setxbkmap and experimented a bit to find what I would call a default set of variants. If I use it manually it seems to work:
/usr/bin/setxkbmap -model pc105 -layout us,hu -variant altgr-intl,qwerty -option 'grp:alt_shift_toggle'
If I add this to i3 config:
exec --no-startup-id "/usr/bin/setxkbmap -model pc105 -layout us,hu -variant altgr-intl,qwerty -option 'grp:alt_shift_toggle'"
it doesn’t work. I tried with or without quotes and doesn’t make a difference.

  1. I would like this setting to exist by default when I log on instead of setting it manually every time.
  2. I wish it would be system wide not just for the specific window. That is super confusing.

There is another issue that seems to be the root of many of my problems. Apparently this is (also) one of those situations when certain things can be set in various ways and they may conflict. I found locale.gen in my /etc and the commands associated with it. If I execute localectl it offers me some regional settings that I’m not even sure where were they set (old settings from when I installed manjaro) but it also contains the language settings (I just can’t switch so it doesn’t work).
Am I supposed to use locale-gen and associated commands to set these things, or should I just use setxkbmap and disregard locale? (they are slightly different things as I can tell but both handle language specific things).
So I guess the third problem is I am not sure what these utilities are and where should I actually configure these things.
I also had a malfunctioning manjaro-settings-manager that was giving an error when setting language related things (can’t set locale) so I just removed it, not sure that was a good idea or not.
System is manjaro up to date, with xorg as far as I can tell.

I’m not sure my setxkbmap or gxkb commands execute from i3 config. Certainly on a reload - super+shift+r - doesn’t seem so.
It could also be that gxkb interferes with all of this somehow overwriting everything with empty config. I found a gxkb.conf that was basically empty, even though I understood it should somehow be updated after a setxkbmap command. Not fully clear on this but tired to dig more.
Also /etc/X11/xorg.conf.d/ can have config file, apparently not supposed to be edited manually, but I was not sure what syntax to use localectl to do it so I just edited it manually and I could add the required layouts here as well, they also get somehow overwritten.
I did notice that if I don’t start gxkb then it works so there’s some conflicts there.
As a workaround I added the config in the 3rd place as well manually - gxkb.conf and now I can use 2 layouts and switch between them with alt-shift.
Spending many hours on this and reading various topics all containing different trial and error suggestions, it appears that unfortunately keyboard configurations are black magic in Linux.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.