Created
February 2, 2020 21:37
-
-
Save freszu/3317f4178361fcc633dbb9c4cb5d3f05 to your computer and use it in GitHub Desktop.
Simple bash script to toggle system preferences for Touchbar shows between "App controls" and "Show F1, F2, etc. Keys
This file contains 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 | |
function readCurrent(){ | |
local current=$(defaults read com.apple.touchbar.agent PresentationModeGlobal) | |
echo "$current" | |
} | |
function setCurrent(){ | |
defaults write com.apple.touchbar.agent PresentationModeGlobal -string $1 | |
pkill "ControlStrip" | |
} | |
functionKeys=functionKeys | |
app=app | |
current=$(readCurrent) | |
if [[ "$current" == "$app" ]]; then | |
setCurrent $functionKeys | |
elif [[ "$current" == "$functionKeys" ]]; then | |
setCurrent $app | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment