Skip to content

Instantly share code, notes, and snippets.

@kosh04
Forked from anonymous/nocaps.sh
Created October 28, 2010 01:58
Show Gist options
  • Save kosh04/650451 to your computer and use it in GitHub Desktop.
Save kosh04/650451 to your computer and use it in GitHub Desktop.
#!/bin/sh
# http://gist.github.com/500229.txt
if [ "$TERM" = "linux" ]; then
# NOTE: dumpkeys & loadkeys command enable superuser only
dumpkeys | sed -e 's/keycode 58 = Caps_Lock/keycode 58 = Control/' | loadkeys
# echo 'keycode 58 = Control' | loadkeys
else
# Make CapsLock an additional Ctrl.
setxkbmap -option ctrl:nocaps
fi
# or
# xmodmap -e 'remove Lock = Caps_Lock'
# xmodmap -e 'add Control = Caps_Lock'
# xmodmap -e 'keysym Caps_Lock = Control_L'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment