[{"data":1,"prerenderedAt":134},["ShallowReactive",2],{"blog-post-/changing-i3-lang":3},{"id":4,"title":5,"body":6,"date":121,"description":122,"draft":123,"extension":124,"image":125,"meta":126,"navigation":127,"path":128,"seo":129,"stem":130,"tags":131,"__hash__":133},"content_en/05.changing-i3-lang.md","How to add a new keyboard input language in i3wm?",{"type":7,"value":8,"toc":118},"minimark",[9,13,16,39,42,55,65,68,71,76,82,96,102,108,114],[10,11,12],"p",{},"So here it goes like this:",[10,14,15],{},"First: You should lookup for your wanted language-layout option name in output of the command below.",[17,18,23],"pre",{"className":19,"code":20,"language":21,"meta":22,"style":22},"language-bash shiki shiki-themes github-dark","localectl list-x11-keymap-layouts\n","bash","",[24,25,26],"code",{"__ignoreMap":22},[27,28,31,35],"span",{"class":29,"line":30},"line",1,[27,32,34],{"class":33},"svObZ","localectl",[27,36,38],{"class":37},"sU2Wk"," list-x11-keymap-layouts\n",[10,40,41],{},"After that: place following code on your i3 configuration.",[17,43,45],{"className":19,"code":44,"language":21,"meta":22,"style":22},"exec_always \"setxkbmap -model pc104 -layout us,ir -variant ,, -option grp:alt_shift_toggle\"\n",[24,46,47],{"__ignoreMap":22},[27,48,49,52],{"class":29,"line":30},[27,50,51],{"class":33},"exec_always",[27,53,54],{"class":37}," \"setxkbmap -model pc104 -layout us,ir -variant ,, -option grp:alt_shift_toggle\"\n",[10,56,57,58,61,62,64],{},"replace ",[24,59,60],{},"ir"," with yours. ",[24,63,60],{}," is a layout name for Persian language ( my native language ).",[10,66,67],{},"After that, reload the i3 configuration and thats should work.",[10,69,70],{},"Lets break that command above :",[10,72,73,75],{},[24,74,51],{}," : In the context of i3wm, this command basically execute the command that you write in front of it ,always when i3wm initialized.",[10,77,78,81],{},[24,79,80],{},"setxkbmap"," : This command in Linux is used to set the keyboard layout and options for the X Window System ( X.org is the open-source implementation of the X Window System and i3 is based on xorg )",[10,83,84,87,88,95],{},[24,85,86],{},"-model pc104"," : This specifies the keyboard model. The ",[89,90,94],"a",{"href":91,"rel":92},"https://en.wikipedia.org/wiki/IBM_PC_keyboard#Keyboard_layouts",[93],"nofollow","pc104"," is actually what we call a full size keyboard ( with numpad and etc, 104 keys in total )",[10,97,98,101],{},[24,99,100],{},"-layout us,ir"," : This option specifies the keyboard layouts to be used.",[10,103,104,107],{},[24,105,106],{},"-variant ,,"," : This specifies the variants of the specified layouts.  we leave it empty so it uses the default variant.",[10,109,110,113],{},[24,111,112],{},"-option grp:alt_shift_toggle"," : This sets options for switching between the specified keyboard layouts. I think the command itself is self-explanatory.",[115,116,117],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":22,"searchDepth":119,"depth":119,"links":120},2,[],"2024-10-09T00:00:00.000Z","If you are using two or more languages in your computer, this is one of the first problems you will encounter in i3wm.",false,"md","/blog-images/i3.png",{},true,"/changing-i3-lang",{"title":5,"description":122},"05.changing-i3-lang",[132],"linux","eX-ONwz_A9K5SxFdAsocBy-D54kUn4emyW4LGhd78JU",1772192624938]