1

I am using setxkbmap on Manjaro-i3 to toggle between keyboard layouts with hotkeys.

The problem is actually a feature that I do not want... Basically, when switching keyboard layout, it sets that layout only for the current window, and when I move to another it takes the old layout again (and the flag icon in the taskbar changes as well).

Is there a way to make it so that it changes the layout for ALL WINDOWS (or just not care about which window is in focus) when toggling keyboard layout ?

I have looked everywhere and cannot find any answer, not even in setxkbmap man page or any other official documentation... So I am guessing that it might not be a feature of setxkbmap itself, but maybe i3... or a hardcoded feature that we cannot change...

Either way there is definitely an issue with how this thing works, this is very broken, because we can also change kb layout by clicking on the icon in the i3-bar, but it changes the layout for the i3-bar and not for any other app since the mouse is above that icon... making this click feature totally useless...

Here is my setxkbmap configuration that runs after i3 init :

setxkbmap -layout us,ca
setxkbmap -option 'grp:alt_shift_toggle

And here is my xorg conf related to keyboard :

Section "InputClass"
  Identifier "system-keyboard"
  MatchIsKeyboard "on"
  Option "XkbLayout" "us,ca"
  Option "XkbOptions" "compose:ralt"
EndSection

Also there is a bug (possibly related) that drives me nuts : Sometimes the default layout changes for new windows that I open...

Thank you for your help.

jww
  • 97,681
  • 90
  • 411
  • 885
ZOlivier
  • 224
  • 1
  • 11

1 Answers1

1

The issue was with sbxkb. That is a very lightweight little program that shows the layout flag icon in the i3-bar, and is responsible for setting the kb layout on a per-window basis. Disabling this app (by executing "killall sbxkb") fixed the issue. Then of course we can disable it from starting on system startup, from the i3 config file. I don't have the flag icon anymore but it was useless to me anyways. Toggling layout with keyboard shortcut still works perfectly, and changes it for the entire system every time.

ZOlivier
  • 224
  • 1
  • 11