how to change language in i3wm

i'm new to i3wm and stuck with the config. I wanted to ask how can I change language in i3wm. I made some search and found some stuff but it's not working in my case. these are two ways that I found

# changing language
exec_always "setxkbmap -model pc104 -layout us,fa_IR -variant ,, -option
grp:alt_shift_toggle"

and

exec "setxkbmap -layout en_US,fa_IR"
exec "setxkbmap -option 'grp:alt_shift_toggle'"

I thought maybe I'm not using the proper name for the persian keyboard layout and I don't know how to find the possible options of the languages. Would appreciate if you can help me sort this out

2 Answers

Everything looks more or less OK except for the layout names.

try using the following command to get list of supported keyboard layouts:

localectl list-x11-keymap-layouts

I used answer from this FAQ in the past:

The only difference is that my solution is for 104 keys keyboard and Russian layout.

Exact line that was working for me.

exec --no-startup-id "setxkbmap -model pc104 -layout us,ru -option grp:alt_shift_toggle"

You could rather run the command in quotes from command line(applies for the single session) or add to the ~/.config/i3/config and use $mod+Shift+c to refresh your config.

The name of the layout option for Persian is ir, use:

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like