我原先发于 CSDN
Change keyboard layout as colemak, and <Esc> with <CapsLock>
For Windows check here
TLDR
# tty
# /etc/vconsole.conf
KEYMAP = colemak
# or
loadkeys colemak
# graphic
setxkbmap us -variant colemakchange to colemak
Temporary
# tty
loadkeys colemak
# graphic
setxkbmap us -variant colemakPermanet
# tty (include graphic)
# /etc/vconsole.conf
KEYMAP = colemakThe above way may not work for Ubuntu, so adding setxkbmap us -variant colemak in ~/.xinitrc may worked. If not see the next section.
Map Esc with CapsLock
setxkbmap us -variant colemak
xmodmap -pke > .xmodmapA small tip: show the key code by xev
Then exchange the key codes of <esc> and <capslock> in .xmodmap file.
Temporary
xmodmap ./.xmodmapPermanet
i3-wm
In ~/.config/i3/config
exec_always sleep 1; xmodmap ~/.xmodmapOthers include i3-wm
# /usr/share/X11/xkb/keycodes/evdev
# exchange the keycodes of <esc> and <capslock>For ubuntu, you could try the following, I forget exactly
sudo dpkg-reconfigure keyboard-configuration