Skip to content

Instantly share code, notes, and snippets.

@salimhossain
Created February 6, 2025 02:30
Show Gist options
  • Save salimhossain/441a49ec141081298d27a4ded60c6158 to your computer and use it in GitHub Desktop.
Save salimhossain/441a49ec141081298d27a4ded60c6158 to your computer and use it in GitHub Desktop.
macOS keyboard brightness shortcut keys (fn + f1 and fn + f2)
<?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>com.local.KeyRemapping</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/hidutil</string>
<string>property</string>
<string>--set</string>
<string>{"UserKeyMapping":[
{
"HIDKeyboardModifierMappingSrc": 0x70000003A,
"HIDKeyboardModifierMappingDst": 0xFF00000009
},
{
"HIDKeyboardModifierMappingSrc": 0x70000003B,
"HIDKeyboardModifierMappingDst": 0xFF00000008
}
]}</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
@salimhossain
Copy link
Author

Save this file to the:: ~/Library/LaunchAgents/com.local.keyRemapping.plist
And restart the mac.

Inspired source 1: https://www.idownloadblog.com/2022/03/25/bring-back-keyboard-brightness/
Inspired source 2: https://gist.github.com/mattbailey/9429c7691467bf82d64e1900c99fb53b
Generated By: https://hidutil-generator.netlify.app/

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