Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Any Spotify desktop user has likely noticed their pervasive notifications: whenever "one of our friends" joins Spotify, there's both an in-app notification as well as a red badge that appears on Spotify's icon in the Dock.

Spotify Dock icon, with badge, for reference

Is there a way to disable an application's ability to show a badge on its Dock icon?

I'm using Lion (10.7.8), and therefore don't have the 'Notifications' prefpane that was introduced in Mountain Lion.

I tried digging around in the app's resources and .plist file to see if there was a setting to enable/disable this... to no avail.

share|improve this question
    
Hiding the app's running status also hides badge notifications: apple.stackexchange.com/questions/68915/… –  y3sh Mar 9 at 14:26

2 Answers 2

No - the normal path is to use the Notifications prefpane to turn off notifications, but this would not help, since Spotify is not listed there.

I'm also very annoyed by Spotify's constant flood of notifications. I wonder if there was a way to drop all the social-related network traffic that goes into Spotify and somehow nip these notifications at the bud.

share|improve this answer

Answer here solves your problem:

# "Usernoted" seems to be the "user notifications daemon", so get it's PID.
pid=$(ps aux | grep -i [u]sernoted | awk '{print $2}')

# Find the sqlite3 database that this program has open. It's in a "private" folder (app sandboxing).
db="$(lsof -p $pid | grep com.apple.notificationcenter/db/db\$ | awk '{print $9}')"

# I got the bundleid from Spotify.app/Contents/Info.plist
bundleid="com.spotify.client"

# I use 0 as the flags because you can change all the settings in System Preferences
# 5 seems to be the default for show_count
# Grab the next-highest sort order
sql="INSERT INTO app_info (bundleid, flags, show_count, sort_order) VALUES ( '$bundleid', 0, 5, (SELECT MAX(sort_order) + 1 FROM app_info) );"

# Run the command
sqlite3 "$db" "$sql"

# Restart usernoted to make the changes take effect
killall user noted

Then you can see Spotify in System Preferences -> Notifications, and can disable its notifications.

share|improve this answer
    
This is brilliant, thanks! However, "Badge app icon" showed up as "off" already (So I'll have to wait for another notification to occur before I can confirm that it worked) –  derrylwc Aug 12 at 22:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.