阻止应用程序在Dock中显示徽章图标


8

任何Spotify桌面用户都可能已经注意到了他们无处不在的通知:每当“我们的一个朋友”加入Spotify时,Dock中Spotify的图标上都会显示一个应用内通知以及一个红色徽章。

带徽章的Spotify Dock图标,以供参考

有没有办法禁用应用程序在其Dock图标上显示徽章的功能?

我正在使用Lion(10.7.8),因此没有Mountain Lion中引入的“ Notifications”预告片。

我尝试在应用程序的资源和.plist文件中进行挖掘,以查看是否有启用/禁用此设置...无济于事。


:隐藏应用程序的运行状态也隐藏徽章通知apple.stackexchange.com/questions/68915/...
y3sh

Answers:


4

否-正常路径是使用“通知”预面板关闭通知,但这无济于事,因为此处未列出Spotify。

我也对Spotify不断涌入的通知感到非常恼火。我想知道是否有办法丢弃所有进入Spotify的与社交相关的网络流量,并以某种方式扼杀这些通知。


4

这里回答可以解决您的问题:

# "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

然后,您可以在系统偏好设置->通知中看到Spotify,并可以禁用其通知。


太好了,谢谢!但是,“徽章应用程序图标”已经显示为“关闭”(因此,我必须等待其他通知发生,然后才能确认它有效)
derrylwc
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.