4

As from the screenshot below, there is a duplicate icon of the xfig program. Sometimes with different programs same thing happens.

enter image description here

Any ideas how to solve this?

4

There can be different causes for an application icon, to show up with a question mark (or otherwise incorrectly) in the Unity launcher.

To start with: application icons are defined in the .desktop file of an application. These .desktop files are (normally) stored in /usr/share/applications, or ~/.local/share/applications

Common causes are:

  • The link to the icon, as defined in the .desktop file of the application, is broken; the icon does not exist or is in the wrong path. effect: the application shows up in the launcher with an incorrect icon (grey question mark).
  • The application is represented by more then one .desktop file. That is: there is more then one .desktop file on your system, with a command to run the application in its first Exec= line. effect: many times, Dash shows more than one (correct) icon, representing the same application. When the application is locked to the launcher, sometimes (or always) if the application runs, another icon appears (the same or slightly different).
  • For various reasons, sometimes the application and the launcher icon are not connected to each other. Although the application is started by the (command in) the .desktop file, the application is not recognized by the .desktop file as "his" application effect: If the application is locked to the launcher, it shows a correct icon, but another one appears when the application runs (grey question mark). If the application is not locked to the launcher, the application is represented by an incorrect icon in the launcher if it runs. (grey question mark, since the binary file has no icon of itself).

In the case of Xfig, the last is the case. You can fix the issue in by adding the following line to the .desktop file:

StartupWMClass=xfig
  • open the application's file (xfig.desktop) with gedit:

    gksu gedit /usr/share/applications/xfig.desktop (you may have to install gksu first)
    
  • Add the line:

    StartupWMClass=xfig
    

Now Xfig will run under its own icon:

enter image description here

  • As I think any other icon errors can be solved via this way, right? – akikara May 13 '14 at 13:50
  • @akikara it depends, do you have many applications with missing icons? reasons can vary. – Jacob Vlijm May 13 '14 at 13:51
  • As I remember sometimes chromium does. – akikara May 13 '14 at 14:01
  • @akikara Chromium can be messy with multiple occurrences of the application / (removed?) webapps etc. – Jacob Vlijm May 13 '14 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.