2

Ubuntu 12.04, xfce4. I run commands from the command line, not from a launcher. (This shouldn't make a difference, but some replies have assumed I want to click on a launcher and that's not the point.)

What I want: when I run the program /usr/bin/zathura (a PDF viewer), I'd like to see the icon zathura.png appear for each window in the windows menu (the menu triggered by middle-mouse on background, or the one triggered by control-Tab to cycle through windows).

This isn't happening! Instead I'm getting a generic icon.

What I've done:

  • Placed the icon zathura.png in /usr/share/app-install/icons (which already contains the icon okular.png, which shows properly when I run okular).

  • Added the line Icon=zathura to the file /usr/share/applications/zathura.desktop (again in imitation of a similar file, okular.png). NOTE: following Tim's suggest I've replaced the imitative Icon=zathura by a full pathname. The file, in its entirety, is this:

    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=Zathura
    Comment=A minimalistic document viewer
    Exec=zathura %f
    Terminal=false
    Categories=Office;Viewer;
    Icon=/usr/share/app-install/icons/zathura.png
    Keywords=PDF;PS;PostScript;DjVU;document;presentation;
    
  • Restarted the window manager (logged out and back in).

Made not the slightest difference!

I then set out to try to break the okular icon to see if I can find where the icon gets associated to an executable. I can't break it! For instance, if I copy /usr/bin/okular to /usr/bin/fooooo and call that new executable, the window thus created still gets the okular icon, even though there is no fooooo.png or fooooo.desktop, or any .desktop with Name=fooooo or Exec=fooooo.

Where is the association between the executable and the icon made?


NOTE: The point is not for the icon to appear on the desktop. It makes no difference to me whether it appears there or not.
(My desktop shows the contents of my home directory.)

1 Answers1

2

This isn't happening! Instead I'm getting a generic icon.

What I've done:

Placed the icon zathura.png in /usr/share/app-install/icons (which already contains the icon okular.png, which shows properly when I run okular).

That's the right thing to do.

  • Added the line Icon=zathura to the file /usr/share/applications/zathura.desktop (again in imitation of a similar file, okular.png). The file, in its entirety, is this:

    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=Zathura
    Comment=A minimalistic document viewer
    Exec=zathura %f
    Terminal=false
    Categories=Office;Viewer;
    Icon=zathura
    Keywords=PDF;PS;PostScript;DjVU;document;presentation;

This is the problem. I believe that it need as absolute path - or at least a file extension. This is because you don't know where the appplication looks by default. For example, cairo-dock is in /usr/share/cairo-dock. So give it the full path like so.

[Desktop Entry]
Version=1.0
Type=Application
Name=Zathura
Comment=A minimalistic document viewer
Exec=zathura %f
Terminal=false
Categories=Office;Viewer;
Icon=/usr/share/app-install/icons/zartha.png
Keywords=PDF;PS;PostScript;DjVU;document;presentation;

I then set out to try to break the okular icon to see if I can find where the icon gets associated to an executable. I can't break it! For instance, if I copy /usr/bin/okular to /usr/bin/fooooo and call that new executable, the window thus created still gets the okular icon, even though there is no fooooo.png or fooooo.desktop, or any .desktop with Name=fooooo or Exec=fooooo.

That's because the link isn't between the name, or executable name, it is with the icon line. Try deleting that, and it will break.

Tim
  • 33,500