为 Linux colemak 修改键

Wed, 2020-02-26

我原先发于 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
avatar
除非注明,本博客所有文章皆为原创。
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。