Skip to content

Instantly share code, notes, and snippets.

@wiedi
Created July 22, 2021 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wiedi/9b7e703f765ea14d16bdc28a0b88381a to your computer and use it in GitHub Desktop.
Save wiedi/9b7e703f765ea14d16bdc28a0b88381a to your computer and use it in GitHub Desktop.
Disable Mac OSX touchbar
#!/bin/bash
#set -x
if [ $# -ne 1 ]; then
echo "Usage:"
echo -e "\t${0} [on|off]"
echo
echo "Be sure to disable SIP:"
echo " - Reboot"
echo " - Hold cmd+R until apple logo shows up"
echo " - Open Terminal and run 'csrutil disable'"
echo " - Reboot again"
exit 0
fi
if [[ "$1" == "on" ]]; then
defaults delete com.apple.touchbar.agent PresentationModeGlobal;
defaults write com.apple.touchbar.agent PresentationModeFnModes '<dict><key>app</key><string>fullControlStrip</string><key>appWithControlStrip</key><string>fullControlStrip</string><key>fullControlStrip</key><string>app</string></dict>';
launchctl load /System/Library/LaunchAgents/com.apple.controlstrip.plist;
elif [[ "$1" == "off" ]]; then
defaults write com.apple.touchbar.agent PresentationModeGlobal -string fullControlStrip;
launchctl unload /System/Library/LaunchAgents/com.apple.controlstrip.plist;
else
echo "Invalid option"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment