S
S
Sergey Burduzha2019-06-20 01:48:08
linux
Sergey Burduzha, 2019-06-20 01:48:08

How to change keyboard layout in i3w using capslock?

Hello.
There are several ways to replace, but none work.
Here's what I got.

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

#bindsym $mod+caps exec ~/.config/i3/i3-keyboard-layout/i3-keyboard-layout set us
#bindsym $mod+caps exec ~/.config/i3/i3-keyboard-layout/i3-keyboard-layout set ru

#setxkbmap -option grp:caps_toggle 'us,ru' -option grp_led:caps

The first 2 lines work and change the layout to alt + shift.
I took 3.4 lines from this example https://github.com/porras/i3-keyboard-layout
I also took the last one from the Internet.
I'm just used to switching to capslock.
Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
4
4rtzel, 2019-06-21
@4rtzel

It is not necessary to put these commands in ~/.config/i3/config because exec will just invoke the shell. For example, I have these commands in ~/.xinitrc .
See all available options for setxkbmap in man
Under "Switching to another layout". For example, to switch using capslock, the following options should work:

setxkbmap -layout us,ru
setxkbmap -option 'grp:caps_toggle'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question