change Caps Lock to Esc in i3
I use vim and i am accustomed to replace the function of caps lock with esc. So, my problem is how could i switch them in i3?
I use vim and i am accustomed to replace the function of caps lock with esc. So, my problem is how could i switch them in i3?
you can modify your keyboard layout with xmodmap. To replace the caps_lock functionality with escape you could execute the following commands on startup:
xmodmap -e "clear lock" #disable caps lock switch
xmodmap -e "keysym Caps_Lock = Escape" #set caps_lock as escape
I don't know a direct i3 solution but you could bind the escape key to xdotool:
bindsym Escape exec xdotool key 66
(66 being the keyCODE for Capslock, maybe check it using xev). Xdotool is available via package management in at least Ubuntu and Arch Linux.
Asked: 2013-03-31 11:21:54 +0000
Seen: 2,176 times
Last updated: Apr 09 '13