Skip to content

Instantly share code, notes, and snippets.

@vslala
Created December 1, 2022 10:51
Show Gist options
  • Save vslala/0e9962bcb847364363855407ab956bb1 to your computer and use it in GitHub Desktop.
Save vslala/0e9962bcb847364363855407ab956bb1 to your computer and use it in GitHub Desktop.
This is to replace tilde key (~) with (§) in new mac keyboard
cat << 'EOF' > ~/.tilde-switch && chmod +x ~/.tilde-switch
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}'
EOF
sh .tilde-switch
# To revert back, run the following:
# hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000035},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000064}]}'
@aytac4w
Copy link

aytac4w commented Dec 27, 2023

No longer works with the latest update. any fixes pls?

@erashdan
Copy link

erashdan commented Jan 6, 2024

Not working anymore
OS Version 14.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment