Prevent Spotify stealing your icons on Ubuntu 14.04

published Aug 26, 2015 11:10   by admin ( last modified Aug 26, 2015 11:25 )

Well, it isn't actually stealing your icons but when interacting with Spotify on Ubuntu 14.04 Linux, it has a tendency to make your icons for applications and other stuff disappear. It seems to do this by switching themes somehow or some sorts. However there is a way of preventing that.

AppArmor is a program that can control what other programs can and cannot do, with regards to file access. It is mainly used for security reasons to make sure that programs, especially binary-only ones whose code you cannot scrutinize (such as Spotify), are not secretly veering off stealing data from your hard disk or mucking about in other ways.

AppArmor can be configured to prevent Spotify from doing this icon-disappearing thingy. In your AppArmor profile for Spotify, add these two lines (tested by me):

# block sni-qt
deny /usr/lib/i386-linux-gnu/qt4/plugins/systemtrayicon/libsni-qt.so r,
deny /usr/lib/x86_64-linux-gnu/qt4/plugins/systemtrayicon/libsni-qt.so r,

Or use the entire profile here https://raw.githubusercontent.com/ozcanesen/spotify-indicator/master/spotify (not tested by me)

"First you need to disable Spotify's indicator. Spotify is using sni-qt package to show indicator. Removing that package will disable indicator but this solution will affect other Qt based applications like Skype. But we got another option to do that. after some research i discovered that this task can be done using AppArmor. I wrote an experimental AppArmor profile, copy this profile and reload AppArmor."