I'm looking for a method that works in both X and the console with console-setup (e.g. xkboptions, no X-exclusive methods like xmodmap
). With XKBoptions, combining ctrl:swapcaps
and caps:swapescape
does not achieve the desired effect – it puts control on capslock (good) and capslock on both the control and escape keys.
For the curious / confused, the rationale is to optimize the keyboard layout by putting more frequently used functions on easy to reach keys.
Since I never use capslock anyways I would also settle for a solution that puts Control on CapsLock and Escape on Control and leaves the Escape key as is (leaving me with no CapsLock function).
Best Answer
Adding a custom XKBOption
Debian uses the XKB system for both Xorg and console, so one method is to add a custom XKBOption. The relevant files on Debian are located under
/usr/share/X11/xkb
, files provided by thexkb-data
package.Create
symbols/custom
Modify
rules/xorg
: look for the section! option = symbols
and add(Optional) Update
rules/xorg.lst
andrules/xorg.xml
(exercise left to reader).Now the
custom:rotatectrlcapsescape
custom XKBOptions is available for use. As per Debian instructions, this is configured by default in/etc/default/keyboard
, with a simpleXKBOPTIONS="custom:rotatectrlcapsescape"
.Ubuntu/Gnome seems to use
rules/evdev*
instead ofrules/xorg*
.Downsides
/usr/
is rarely a good idea. The modified files will probably be clobbered the next time the owning package (xkb-data
) updates.