Tuesday, October 6, 2015

How To Disable The Spotify Tray / AppIndicator Icon In Ubuntu

The native Spotify Linux client uses a tray icon / appindicator that can't be set by the icon theme so it doesn't integrate with the rest of the Ubuntu desktop. Furthermore, Spotify is integrated in the Ubuntu Sound Menu so the tray icon is not needed.

Below you'll find two ways of removing / hiding the Spotify tray icon.

Spotify tray icon Ubuntu

After using the instructions below to disable / hide the Spotify tray icon, you'll have to exit Spotify by selecting File > Exit from its menu

Don't click the close button on the Spotify window because that won't close Spotify, it will only hide its window. If you accidentally close Spotify using the window close button, you can bring back its window by opening Spotify again from the menu / Dash (that won't open another Spotify instance and instead, it will only bring back the running Spotify window).

Notes:
  • Ubuntu 12.04, 12.10 and 13.04 only: instead of the instructions below, you can also use a variation of the Spotify Ambiance theme that hides the tray icon, which you can find HERE (look under "Other downloads).
  • the Spotify tray icon is turned into an AppIndicator in Ubuntu by the sni-qt package - you could remove this package to disable the Spotify AppIndicator/tray icon but this will also disable the tray icon to appindicator conversion for other Qt applications such as Skype, VLC and so on, so I don't recommend it.

How to disable / hide the Spotify tray icon in Ubuntu


Spotify Linux client running on Ubuntu 14.04 with no tray / appindicator icon

Method 1: Ubuntu 12.04, 12.10 and 13.04 only (doesn't work for newer Ubuntu releases)

Using the instructions below, the Spotify tray icon will not be removed but it will be hidden. This has the advantage that you can continue to use the HUD (if you use Unity) to access the items available in the Spotify tray icon: pause, next, previous, shuffle or repeat, as well as hide/show the Spotify window or quit Spotify.


To hide the Spotify tray/appindicator icon, firstly make sure Spotify is closed, then use the following commands:

1. Make a backup:
sudo cp /opt/spotify/spotify-client/Data/resources.zip /opt/spotify/spotify-client/Data/resources.zip.old

2. Hide the Spotify tray icon:
sudo apt-get install zip
sudo zip --delete /opt/spotify/spotify-client/Data/resources.zip "_linux/*.ico"
The last command above deletes the .ico files from the "resources.zip" file from the Spotify Data folder, so the icon no longer appears on the top Ubuntu panel.

Method 2: any Ubuntu version (including 13.10 and 14.04, which are not supported by the first method)

The second method uses an AppArmor profile (via Özcan Esen) to completely disable the Spotify tray/appindicator icon.

To completely disable the Spotify tray icon, firstly make sure Spotify is closed, then use the following commands:
wget http://raw.github.com/ozcanesen/spotify-indicator/master/spotify -O /tmp/spotify
sudo cp /tmp/spotify /etc/apparmor.d/
sudo service apparmor reload


How to revert the changes


If you've used Method 1, revert the changes using the following command (firstly make sure Spotify is closed):
sudo mv /opt/spotify/spotify-client/Data/resources.zip.old /opt/spotify/spotify-client/Data/resources.zip

If you've used Method 2, you can revert the changes using these commands (make sure Spotify is closed):
sudo rm /etc/apparmor.d/spotify
sudo service apparmor reload

Also see: Spotify Ambiance theme (comes with monochrome icons for the Spotify tray/appindicator)

No comments:

Post a Comment