Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed spotify on Ubuntu 13.04 and have locked the icon on the launcher. But when I exit the program fully or even restart and use that icon to open spotify, a new icon is created or a different icon is generated with a ? on it.

It is a clean install of Ubuntu 13.04 so was wondering if this is a known bug or if there was a way of making sure it just doesn't created a duplicate icon?

N.B it has not happened as of yet to any other program I have installed (Chrome & Steam)

share|improve this question
To me, this looks like a bug in Spotify and should be reported as a bug to them. I think they expect the user to keep Spotify running and use the indicator to show/hide it, rather than exit and later restart from the Launcher. Note the 2 different arrows next to the 2 icons, one indicating the launcher icon, the other showing a running instance. The failure of these 2 icons to merge is not, I think, something you can change with settings. – chaskes Nov 10 '13 at 1:50
Seems linked to how soon I start it up on my computer, wait a minute then launch - or quit then relaunch, must be a bug in how it launches all it's services - or it not waiting for something it needs be launched properly. – Mateo Nov 10 '13 at 2:13
This happens or has happened with a variety of software: it is a consequence of the way Unity (and specifically a library called bamf) works. – Alistair Buxton Nov 11 '13 at 8:21
@AlistairBuxton so this is a bug in bamf or Spotify? – Salem Nov 15 '13 at 21:46
It's a bug in bamf. See for example: bamf is the "bamf application matching framework" - it's job is to detect whether two windows belong to the same application and thus should be stacked under the same launcher icon or not. There is no reliable way to do this for all applications, so bamf exists specifically to handle corner cases like java and spotify. – Alistair Buxton Nov 16 '13 at 9:11

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]
GenericName=Music Player
Comment=Listen to music using Spotify
Exec=spotify %U

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:

share|improve this answer
Unfortunately, this solution does not function on Ubuntu 14.04. If you have a different workaround please post it. – Luís de Sousa Aug 21 '14 at 17:31
nope, it is the same situation, "even with the desktop file below results seem inconsistent and buggy." try diffrent combitnations of closing the window/quiting in the indicator, then locking/unlocking the launcher, as well as editing the launcher in /usr/share/applications – Mateo Aug 21 '14 at 21:30

Then remove the Icon in the launcher which you have previously locked to launcher and mark the icon which came after to launcher.

I am not saying that do this everytime. I am thinking that the launcher accessing the same Icon everytime from somewhere remove the locked one and keep the new one. Then have restart and try again.

share|improve this answer
On Ubuntu 14.04 this procedure removes all the Spotify icons from the launcher. – Luís de Sousa Aug 21 '14 at 17:29

You can avoid the bug if you first click Hide Spotify (in the system tray icon) before exiting Spotify completely.

share|improve this answer
Not a solution on Ubuntu 14.04. – Luís de Sousa Aug 21 '14 at 17:31

Your Answer


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.