Created
July 10, 2020 19:27
-
-
Save realytcracker/8d0fccda41880c4edad07ed0c726929f to your computer and use it in GitHub Desktop.
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 | |
# quickly turn handoff and airplay on or off | |
# usage: ./handplay.sh [on | off] | |
if [ "$1" == "off" ]; then | |
defaults write com.apple.NetworkBrowser DisableAirDrop -bool yes | |
defaults write "$HOME/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist" ActivityAdvertisingAllowed -bool no | |
defaults write "$HOME/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist" ActivityReceivingAllowed -bool no | |
echo "handoff and airplay are off." | |
elif [ "$1" == "on" ]; then | |
defaults write com.apple.NetworkBrowser DisableAirDrop -bool no | |
defaults write "$HOME/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist" ActivityAdvertisingAllowed -bool yes | |
defaults write "$HOME/Library/Preferences/ByHost/com.apple.coreservices.useractivityd.plist" ActivityReceivingAllowed -bool yes | |
echo "handoff and airplay are on." | |
else | |
echo "usage: $0 [on | off]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment