-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathremap-right-opt-macos.sh
More file actions
executable file
·29 lines (27 loc) · 964 Bytes
/
remap-right-opt-macos.sh
File metadata and controls
executable file
·29 lines (27 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
#
# Absolute life saver script for Logi MX keyboard users on macOS.
# For typing special characters with an international keyboard layout,
# you need the right Opt key, which is reachable only with the pinky
# on the Logi MX macOS layout. This script swaps right Cmd (which is
# right Alt on Windows) and right Opt.
#
# To apply the fix on boot, add it as a login item in the system Preferences
# (will open a Terminal at startup) or copy local.user.remap-right-opt-macos.plist
# to ~/Library/LaunchAgents and update the path in it to point to this script.
#
# Cudos to https://gist.github.com/dkoprowski/4c6cd49343792ce38ed839d382add22a
# for this fix!
#
hidutil property --set '{
"UserKeyMapping": [
{
"HIDKeyboardModifierMappingSrc": 0x7000000e7,
"HIDKeyboardModifierMappingDst": 0x7000000e6
},
{
"HIDKeyboardModifierMappingSrc": 0x7000000e6,
"HIDKeyboardModifierMappingDst": 0x7000000e7
}
]
}'