After running the command above, the output of localectl is:
System Locale: LANG=en_US.UTF-8
VC Keymap: us
X11 Layout: us,is
X11 Model: pc105
X11 Options: grp:alt_shift_toggle
I then reboot my computer. Once I login, the keyboard is set to us, which is what I want, but I can’t toggle between us and is. I’ve tried to fix this myself by googling but to no avail. I would appreciate any help.
Note that setxkbmap adds options specified in the command line to the options
that were set before (as saved in root window properties). If you want to replace all previously specified options,
use the -option flag with an empty argument first.
# 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,is"
Option "XkbModel" "pc105"
Option "XkbOptions" "grp:alt_shift_toggle"
EndSection
Not that I know. This is my first time using EOS and i3wm. I changed grp:alt_shift_toggle to grp:caps_toggle without any success so the problem is not restricted to alt/shift.
@richlinux Thanks for the link but unfortunately no dice.
Yes. But like i understand it, the keyboard layout switching, is handled by X11 self.
How do you start i3wm? With a login manager?
You could disable that temporarly, than start from TTY a X11 Session without anything, only with xterm, and test if it is working. If yes, it is a problem with i3wm than.
Using X configuration files
Note: xorg.conf is parsed by the X server at start-up. To apply changes, restart X.
The syntax of X configuration files is explained in Xorg#Configuration. This method creates system-wide configuration which is persistent across reboots.
Here is an example:
/etc/X11/xorg.conf.d/00-keyboard.conf
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "cz,us"
Option "XkbModel" "pc104"
Option "XkbVariant" ",dvorak"
Option "XkbOptions" "grp:win_space_toggle"
EndSection
Using localectl
For convenience, the tool localectl may be used instead of manually editing X configuration files. It will save the configuration in /etc/X11/xorg.conf.d/00-keyboard.conf, this file should not be manually edited, because localectl will overwrite the changes on next start.
The usage is as follows:
# localectl [--no-convert] set-x11-keymap layout [model [variant [options]]]
To set a model, variant or options, all preceding fields need to be specified, but the preceding fields can be skipped by passing an empty string with "". Unless the --no-convert option is passed, the specified keymap is also converted to the closest matching console keymap and applied to the console configuration in vconsole.conf. See localectl(1) for more information.
To create a /etc/X11/xorg.conf.d/00-keyboard.conf like the above:
# localectl --no-convert set-x11-keymap cz,us pc104 ,dvorak grp:win_space_toggle
" this file should not be manually edited, because localectl will overwrite the changes on next start. "
I installed EndeavorOS + i3wm on a virtual machine, ran the localectl from OP, forced the VM install to boot in tty, ran startx and then xterm. In that terminal the alt/shift binding worked flawlessly.
I don’t know where to go from here but this is progress!
Edit: Forgot to mention that the problem appeared on the clean install on the VM before doing the tty stuff. Switching back to graphical.target the problem has reappeared.
Dont know, and this must answer a EndeavourOS dev, or somebody knows, but is X11 used with i3wm? Or Wayland?
Do you know wich Login Manager is used with i3wm?
And for interest, are the keybindings from i3wm self working? If yes, you could circumvent the whole problem and set in i3wm self a hotkey/what_ever to execute the switching… (not the finest solution, but possible)