#!/bin/sh
## This script hides the annoying apple music group on the left nav of
## Music.app that they intentionally force on the app.
#
# To use, open TextEdit (spotlight search), copy/paste to in to TextEdit, save
# to ~/Desktop/fix.sh, then double click it on your desktop.
#
# Two options: either use LittleSnitch to filter outgoing net traffic to Apple
# for the specific daemon used by Music.app (I don't know which that is yet),
# or create a script, use Alred/Keyboard Maestro etc to open Music.app with
# this script, and argument "open" to this script.
#
# If you use LittleSnitch, you must disable iCloud and macOS services rule
# groups in LittleSnitch, otherwise Music.app will use a proxy daemon to
# contact apple services to get (probably) the radio/itunes etc metadata and
# will restore the side bar group.
PLIST=~/Library/Preferences/com.apple.Music.plist
if [ "$1" == "--help" ] ; then
echo "usage: $0 [explore] [open]"
exit 0
fi
if [ "$1" == "explore" ] ; then
open $PLIST
shift
else
defaults write $PLIST haveRadioState 0
## other various settings I tried to get rid of the "Store" group, that didn't
## work
#
# defaults write $PLIST storeSupportsUPP -bool false
# defaults write $PLIST storeSupportsCloudPurchases -bool false
# defaults write $PLIST doesStoreSupportCloudMusicLibrary -bool false
# defaults write $PLIST storeSupportsPreviousPurchases -bool false
# defaults write $PLIST storeSupportsPasswordSettings -bool false
fi
if [ "$1" == "open" ] ; then
osascript -e 'tell application "Music" to activate'
fi