Last active
January 25, 2018 10:54
-
-
Save micheller/638f684c0bb38686fac1b2ead9864b89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# swapcaps.sh | |
#!/bin/sh | |
if [[ $(xmodmap -pk | grep Caps | awk '{print $1}') = 22 ]]; then | |
# already configured, do nothing. | |
exit 0 | |
fi | |
# remove special key lock and swap caps with backspace | |
xmodmap -e "remove Lock = Caps_Lock" | |
xmodmap -e "keycode 66 = BackSpace" | |
xmodmap -e "keycode 22 = Caps_Lock" | |
# swapback.sh | |
#!/bin/sh | |
if [[ $(xmodmap -pk | grep Caps | awk '{print $1}') = 66 ]]; then | |
# already configured, do nothing. | |
exit 0 | |
fi | |
# add special key lock and swap caps with backspace | |
xmodmap -e "keycode 66 = Caps_Lock" | |
xmodmap -e "keycode 22 = BackSpace" | |
xmodmap -e "add Lock = Caps_Lock" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment