#!/bin/sh # Increase key speed xset r rate 200 50 # Switch caps and esc setxkbmap us -option caps:swapescape # When caps lock is pressed only once, treat it as escape killall xcape 2>/dev/null xcape -e 'Super_L=Escape' # Turn off caps lock if on since there is no longer a key for it xset -q | grep -q "Caps Lock:\s*on" && xdotool key Caps_Lock