⌨️ Map CAPS Lock to Control
Thursday 2 March 2023

Here is a script to map CAPS_LOCK to CONTROL: ⌨️

 1#!/bin/sh
 2
 3# Remap the CapsLock key to a Control key for
 4# the X Window system.
 5if type setxkbmap >/dev/null 2>&1; then
 6  setxkbmap -layout us -option ctrl:nocaps 2>/dev/null
 7fi
 8
 9# Remap the CapsLock key to a Control key for the console.
10(dumpkeys | grep keymaps; echo "keycode 58 = Control") | loadkeys

#keyboard

See Also