It is a bug, this is a partial workaround.
To workaround quit out using the launcher (or just closing the window) and relaunch leaving the indicator in the top menu running) even with the desktop file below results seem inconsistent and buggy.
Create a new launcher that has StartupWMClass=Spotify
defined.
You can make a spotify.desktop
file with these contents:
[Desktop Entry]
Name=Spotify
GenericName=Music Player
Comment=Listen to music using Spotify
Icon=spotify-client
Exec=spotify %U
TryExec=spotify
Terminal=false
Type=Application
Categories=Qt;Audio;Music;Player;AudioVideo
MimeType=x-scheme-handler/spotify
StartupWMClass=Spotify
Or edit the orginal from /opt/spotify/spotify-client/spotify.desktop
(requires superuser permissions) adding the line StartupWMClass=Spotify
at the end
Save it somewhere you can keep it like "Documents". Then drag it to the launcher.
This will make sure that the windows with the WMClass named spotify will open under that icon.
Code to get WMClass of a window:
xprop|grep WM_CLASS
This returns the following when clicking on the spotify window:
WM_CLASS(STRING) = "spotify", "Spotify"
(This seems to only partially solve the issue, completely exiting will probably end up with two icons again)
Note: I noticed that the problem started happening less and less the more I launched it - this is probally due to my system having preload installed, it might help:
https://apps.ubuntu.com/cat/applications/preload/
It appears that the tray icon cannot be enabled for the 1.0.x client at this time. The issue appears to be longstanding, and is so mentioned at the Spotify community forums: "Linux Spotify client 1.x now in stable"
Regarding bugs/issues in 1.0.23:
Most of these we want to fix, but others (like missing tray icon) we probably won't.
For now, Spotify is not willing/able to devote enough development resources to the Linux client. I have remained on the "spotify-client-0.9.17" package, while periodically checking the functionality of the 1.0.x testing releases (I have both the "stable" and "testing" repositories). The '0.9.17' client is disappointingly flakey sometimes (esp. "Spotify Helper" processes), but it still gives me a tray icon and panel info/support with 14.04.
Best Answer
I found this, and it's actually excellent. Download, extract, copy
resources.zip
to/opt/spotify/spotify-client/Data
(overwriting the existing file), and restart Spotify.UPDATE: Spotify released a new update, and allowing the update rewrites the
resources.zip
file. The theme has considerably changed, so the same zip won't work - however, you just need to copy overresources.zip
, extract, and in the_linux
subdirectory, delete all files and copy over_linux/spotify_icon.ico
from the one that you downloaded, zip it back up and copy the zip file back