Author Topic: To packagers : display of Icons in menus (ie:Openbox right-click menus)  (Read 1769 times)

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Hi,

The newer Openbox, 3.5.0 allows to display the icons in the menus. As usual, an Openbox "as is" will need to configure the icons one by one in the menus, but fortunately we will not need to do this ! the newer Openbox-menu will take care of it as it does for the dynamic menus.

So I tested in my machine and was in a wonder because the icons are there but not all. So I wondered why some of them are not displayed : are they missing ? Probably not, for some of them at least, so I went to the related desktop files and did some observations.

Missing icons : Addlocale, OOo4Kids-manager, Lomanager, Network-center (to give a few examples).

Addlocale has for call "Icon=localedrake.png". When I removed the ".png", the icon appeared.
Network-center has for call "Icon=/usr/share/mcc/themes/default/netcenter.png". Here removing the ".png" didn't help, so I commented the line, replaced it with "Icon=netcenter" and added a symlink to /usr/share/icons" pointing to /usr/share/mcc/themes/default/netcenter.png (the symlink is netcenter.png pointing to /usr/share/mcc/themes/default/netcenter.png).

Same for obmenu : this package has a desktop file containing an icon with the .png extention, then the icon does not appear in the menus.
What about changing the name for the symlink ? ie in /usr/share/icons:
ln -s /usr/share/obmenu/mnu48.png obmenu.png

and in the desktop file, simply : "Icon=obmenu". That works !

I prefer to tell you that I don't know why the file extension should not be present in the desktop files as argument to the Icon variable, but this is something I noticed since a long time.

The places : the places taken in account for menus are the icon theme chosen, then the hicolor-icon theme as fallback, and also the directory /usr/share/icons. It seems that icons placed in other directories will be ignored.

I wanted to come tell about it... because it's when the packages are being built that this detail can be taken care of. :)
Thanks,
Mélodie


PS: a pic


PS: icons in /usr/share/pixmaps are seen too. Example:
Quote
#Icon=/usr/share/pixmaps/mc.png
Icon=mc


does work, but
Quote
Icon=/usr/share/pixmaps/mc.png


didn't allow to display mc's icon.



« Last Edit: August 05, 2011, 07:06:01 PM by melodie »
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: To packagers : display of Icons in menus (ie:Openbox right-click menus)
« Reply #1 on: August 05, 2011, 11:34:07 PM »
Melodie,

Just for /usr/share/applications/mc.desktop file, try this. Edit the desktop file, and comment the line TryExec=mc. Save the file, then see if the icon shows up. I had this problem with a desktop file, (forgot which one), and Leiche found the solution.

Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: To packagers : display of Icons in menus (ie:Openbox right-click menus)
« Reply #2 on: August 06, 2011, 02:14:41 AM »
Melodie,

Just for /usr/share/applications/mc.desktop file, try this. Edit the desktop file, and comment the line TryExec=mc. Save the file, then see if the icon shows up. I had this problem with a desktop file, (forgot which one), and Leiche found the solution.




Hi,

What you say is not correct. The command TryExec does not have that function.
http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html

Quote
TryExec   Path to an executable file on disk used to determine if the program is actually installed. If the path is not an absolute path, the file is looked up in the $PATH environment variable. If the file is not present or if it is not executable, the entry may be ignored (not be used in menus, for example).    string   NO   1


Theses are the files I corrected by hand, the way I explained above:
Quote
[melodie@localhost ~]$ cd /usr/share/applications/
[melodie@localhost applications]$ ls -l *backup
-rw-r--r-- 1 root root 2186 août   6 01:57 addlocale.desktop-backup
-rw-r--r-- 1 root root 1256 août   6 01:58 draknetcenter.desktop-backup
-rw-r--r-- 1 root root  478 août  24  2009 galculator.desktop-backup
-rw-r--r-- 1 root root 1717 août   6 02:56 glabels-3.0.desktop-backup
-rw-r--r-- 1 root root 8815 août   6 03:00 gucharmap.desktop-backup
-rw-r--r-- 1 root root 3035 août   6 02:58 lomanager.desktop-backup
-rw-r--r-- 1 root root  859 août   6 03:02 mc.desktop-backup
-rw-r--r-- 1 root root 2873 août   6 02:59 OO4kidsmanager.desktop-backup
-rw-r--r-- 1 root root  255 août   6 03:01 scite.desktop-backup
-rw-r--r-- 1 root root 1352 nov.  12  2010 xmms.desktop-backup
-rw-r--r-- 1 root root  807 août   6 02:59 zathura.desktop-backup
[melodie@localhost applications]$


and also obmenu.desktop, the way explained above, now they all show in the right-click menu. (You will get the same in the future PCLinuxOS Openbox versions if all goes well in the next days).

Obviously I don't intend to do it for all the missing icons, be it for myself or for publishing. The incorrect desktop files are too numerous, they will be overwritten once an update arrives, and it is much better if they are written the correct way from the beginning !

Wrong desktop file:
Zathura : Icon=pdficon.png

Correct desktop file
Icon=pdficon

Else, you can find where are the inherits in the index.theme inside the main theme you have configured. (+ icons found in /usr/share/icons, + icons found in /usr/share/pixmaps)


melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode

Offline djohnston

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6227
  • I don't do Windows
Re: To packagers : display of Icons in menus (ie:Openbox right-click menus)
« Reply #3 on: August 06, 2011, 12:31:26 PM »

What you say is not correct. The command TryExec does not have that function.
http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html


http://www.pclinuxos.com/forum/index.php/topic,93785.msg788683.html#msg788683

found the error...

LXDE User must remove this line
Code: [Select]
TryExec=dbus-launch mirofrom desktop file, and it will display in the startmenu...


Bare metal                           VBox
AMD Athlon 7750 Dual-Core    Single core
4GiB RAM                              1GiB RAM
nVidia GeForce FX 5200          64MB video
LXDE 32bit                            KDE 64bit

Registered Linux User #416378

Offline melodie

  • Hero Member
  • *****
  • Posts: 5942
  • XMMP=Jabber, free instant messaging protocol !
    • PCLinuxOS Fr
Re: To packagers : display of Icons in menus (ie:Openbox right-click menus)
« Reply #4 on: August 07, 2011, 04:46:59 AM »
So what are you saying ? That a wrong command line in the wrong variable had the wrong effect in the display of the icons in your menus ? :)

I would not be astonished. TryExec as I understood it needs full path to an executable, and I am not quite sure about it's utility... even if that must exist for some reason. So obviously "dbus-launch miro" in front of a TryExec looks like nonsense...

Little by little all my menus are getting icons, so when I will have them all I'll publish a list of desktop files which would need corrections (even if I don't have all the packages from the repo installed, maybe some other users will follow and add theirs to the list ?) For some, I'll also submit a new icon (ie: pino has icons, but none as png in 48x48 pixels size, and none at the right place).
melodie at swissjabber dot ch - IRC #pclinuxos-fr sur freenode