MediumLinux homelab — swap Ctrl and Caps keys in console mode - Thomas Bucaioni - Medium
Sitemap

Linux homelab — swap Ctrl and Caps keys in console mode

Jan 16, 2026

--

Goal: swap keys directly by editing the layout mapping

Get Thomas Bucaioni’s stories in your inbox

Join Medium for free to get updates from this writer.

Dump the current layout, for example dvorak

mkdir -p /etc/kbd/
dumpkeys > /etc/kbd/dvorak-ctrlcaps.map

Change the 29 and 58 entries

keycode  29 = Control         
keycode 58 = Caps_Lock

Test it

loadkeys /etc/kbd/dvorak-ctrlcaps.map

Make it persistent in /etc/vconsole.conf

KEYMAP=/etc/kbd/dvorak-ctrlcaps.map
Press enter or click to view image in full size

--

--

Thomas Bucaioni
Thomas Bucaioni

Written by Thomas Bucaioni

System administrator in southern France