Skip to content

Instantly share code, notes, and snippets.

@gordey4doronin
Last active May 15, 2021 09:02
Show Gist options
  • Save gordey4doronin/2680280ea2af0b1a95fa9e560a6968f1 to your computer and use it in GitHub Desktop.
Save gordey4doronin/2680280ea2af0b1a95fa9e560a6968f1 to your computer and use it in GitHub Desktop.
Remap Tilda and Paragraph buttons on a macbook keyboard https://apple.stackexchange.com/a/374074/351784
#!/bin/sh
# Replaces tilda with left shift (literally making left shift button "longer")
# Replaces paragraph with tilda (so your tilda is in top left corner under escape now)
hidutil property --set '{"UserKeyMapping":[
{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x7000000E1},
{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}
]}'
#!/bin/sh
# Removes any remappings and resets back to initial state just by passing an empty array
hidutil property --set '{"UserKeyMapping":[]}'
#!/bin/sh
# Swaps paragraph and tilda (so your tilda is in top left corner under escape now and paragraph is on the left from z)
hidutil property --set '{"UserKeyMapping":[
{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},
{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}
]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment