I am using 'i3` window manager on Fedora 25. I've already uninstalled GNOME Desktop. I want to change keyboard layout and set it to languages other than English, and desirably also to set it as Alt+Shift shortcut for easy access.

up vote 22 down vote accepted

You can use setxkbmap:

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

Just change the keyboard layouts us,de to what ever you prefer. If you want i3 to run these commands on startup, just add them to your config file "~/.i3/config" and prepend "exec".

exec "setxkbmap -layout us,de"
exec "setxkbmap -option 'grp:alt_shift_toggle'"

Checkout http://docs.slackware.com/howtos:window_managers:keyboard_layout_in_i3

  • Thanks, is it possible to add an indication of it on i3bar as well? – w17t Dec 1 '16 at 14:07
  • Yes, it is. See docs.slackware.com/… – tomsal Jan 13 '17 at 10:28
  • this just doesn't work, nothing changes when using alt-shift =( – Yurii Aug 19 '17 at 16:59
  • Have you tried using the setxkbmap commands from the command line (without the i3 config)? What does it say when you run setxkbmap -query? – tomsal Aug 20 '17 at 19:50

For me only the following worked in Manjaro + i3:

exec_always "setxkbmap -model pc104 -layout us,ru,ua -variant ,, -option grp:alt_shift_toggle"

I specified this in ~/.config/i3/config file

It indeed seems that everything must be written inside a single command in the i3 config file in order for setxkbmap to work as desired, at least on Arch linux.

Example: English + Czech qwerty keyboard, ALT+SHIFT toggle:

exec "setxkbmap -option 'grp:alt_shift_toggle' -layout us,cz -variant ,qwerty"

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.