On KDE (and on GNOME as well), there was an option to swap Caps Lock and Escape key.
I was expecting this same setting window in i3, but I didn't find one. Is there any similar setting in i3?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityOn KDE (and on GNOME as well), there was an option to swap Caps Lock and Escape key.
I was expecting this same setting window in i3, but I didn't find one. Is there any similar setting in i3?
You can use xmodmap
to swap Escape and Caps Lock on any DE.
First create a file with the following contents:
remove Lock = Caps_Lock
keycode 0x42 = Escape
keycode 0x9 = Caps_Lock
add Lock = Caps_Lock
Let's suppose it is saved as swapkeys
.
Run the following command to swap the keys:
xmodmap swapkeys -display :0
assuming $DISPLAY
is :0
.
You can add the above line to your i3 config to execute automatically on startup.
Also the following will do the same:
config file: ~/.config/i3/config or user defined
xmodmap -e "clear lock"
#disable caps lock switch
xmodmap -e "keysym Caps_Lock = Escape"
set caps_lock as escape
just for simple config at one place