Created
January 30, 2024 15:15
-
-
Save melmatsuoka/ca89d1e55a644e12a4101c4dd0c09dcc to your computer and use it in GitHub Desktop.
Toggle Function/Media keys on macOS
This file contains hidden or 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
#!/bin/bash | |
# | |
# Toggles the state of the "Use F1, F2, etc. keys as standard function keys" option | |
# in the System Keyboard Shortcuts settings in Ventura & Sonoma | |
if [[ $(defaults read -g 'com.apple.keyboard.fnState') == '0' ]] | |
then | |
defaults write -g 'com.apple.keyboard.fnState' -boolean true | |
else defaults write -g 'com.apple.keyboard.fnState' -boolean false | |
fi | |
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment