Created
October 15, 2020 13:56
-
-
Save look4regev/a48730aaee58b21d7f2d6fa9c4dc88f0 to your computer and use it in GitHub Desktop.
Swap Mac ± and ~ keys script
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
# Taken from https://ppolyzos.com/2020/10/09/swap-places-between-tilde-and-section-sign-%C2%A7-key-in-your-macbook-keyboard/ | |
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}' | |
sudo /usr/bin/env bash -c "cat > /Library/LaunchAgents/org.custom.tilde-switch.plist" << EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.custom.tilde-switch</string> | |
<key>Program</key> | |
<string>${HOME}/.tilde-switch</string> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>KeepAlive</key> | |
<false/> | |
</dict> | |
</plist> | |
EOF | |
sudo launchctl load -w -- /Library/LaunchAgents/org.custom.tilde-switch.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment