我原先发于 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 colemak
change to colemak
Temporary
# tty
loadkeys colemak
# graphic
setxkbmap us -variant colemak
Permanet
# tty (include graphic)
# /etc/vconsole.conf
KEYMAP = colemak
The 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 > .xmodmap
A small tip: show the key code by xev
Then exchange the key codes of <esc>
and <capslock>
in .xmodmap
file.
Temporary
xmodmap ./.xmodmap
Permanet
i3-wm
In ~/.config/i3/config
exec_always sleep 1; xmodmap ~/.xmodmap
Others 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