WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: freedesktop standard for icons and .desktop files.  (Read 10125 times)

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
freedesktop standard for icons and .desktop files.
« on: April 19, 2010, 09:13:46 AM »
Please mention here if any extensions are having issues displaying icons in any of TC's window managers/desktop environments and they will be addressed.  Be sure to fetch the extension fresh from the repo or update your existing ones before reporting issues.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: freedesktop standard for icons and .desktop files.
« Reply #1 on: April 19, 2010, 09:31:09 AM »
This is not mentioned, but it is for TC 2.11
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: freedesktop standard for icons and .desktop files.
« Reply #2 on: April 19, 2010, 10:36:17 AM »
For 2.11, thanks.

The part of the .desktop file to pay attention to is the Icon and X-FullPathIcon entries.  X-FullPathIcon is to support legacy window managers.  Here is the preferred format:

Icon=icon                       
X-FullPathIcon=/path/to/icon.png  

The best place to place the icon is in /usr/local/share/pixmaps/icon.png since that will also be picked up by freedesktop compliant WMs by the Icon=icon or Icon=icon.png entry.  The X-FullPathIcon entry needs the full path and the icon suffix (png,etc) but the Icon entry does not by freedesktop standards.  However, some DE's have an issue with themes when the full path is listed in the Icon entry.  So do not put the full path in the Icon field.  

Also, the .desktop file needs to share the same name as the extension.  If there are more than one .desktop files in an extension, then one of them needs to match the extension name and follow the above format.  The extra .desktop files that are of a different name do not have to follow the new format.

More info will follow, but this is how to adjust existing extensions and new ones need a .desktop file in /usr/local/share/applications that is in this format.
« Last Edit: May 01, 2010, 07:50:32 PM by Jason W »

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: freedesktop standard for icons and .desktop files.
« Reply #3 on: May 01, 2010, 07:51:46 PM »
Important change - Icon field needs to be Icon=icon rather than Icon=icon.png as not all desktop environments play well with Icon=icon.png, even though Icon=icon.png is freedesktop compliant.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: freedesktop standard for icons and .desktop files.
« Reply #4 on: May 02, 2010, 01:33:52 AM »
Important change - Icon field needs to be Icon=icon rather than Icon=icon.png as not all desktop environments play well with Icon=icon.png, even though Icon=icon.png is freedesktop compliant.

No,  Icon=icon.png is not freedesktop compliant.

There are two options:

1)

Icon=xxx

where xxx.png (or xxx.svg) is in the /usr/local/share/pixmaps directory or xxx is element of the active Icon Theme

2) an absolute path

Icon=/usr/local/share/pixmaps/xxx.png

I will add a guide to WIKI for extension creators.
« Last Edit: May 02, 2010, 01:38:37 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: freedesktop standard for icons and .desktop files.
« Reply #5 on: May 02, 2010, 05:37:43 AM »
According to freedesktop standards, Icon=icon.png is compliant.  Look at "Example Desktop Entry File" section of the page below:

http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html

But even so, we are making efforts to accommodate all DE's even if they don't play well with all freedesktop compliant Icon entry formats. 

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: freedesktop standard for icons and .desktop files.
« Reply #6 on: May 02, 2010, 06:22:17 AM »
According to freedesktop standards, Icon=icon.png is compliant.  Look at "Example Desktop Entry File" section of the page below:

http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html

But even so, we are making efforts to accommodate all DE's even if they don't play well with all freedesktop compliant Icon entry formats.  

Good finding. I had a discussion with PCMan regarding icon handling in PCManFM2 and his view that this is not compliant.  This is a good point to continue discussion :)

Lets say, it is a bug in PCManFM2 and leave extensions as they are as this is working in other DE environment. PCManFM2 anyhow is a beta software. However, it is a relly a polite stuff to make TC repo work fine even with this :)
« Last Edit: May 02, 2010, 06:31:00 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: freedesktop standard for icons and .desktop files.
« Reply #7 on: May 02, 2010, 06:36:39 AM »
The upcoming 3.x repo has had it's desktop files converted to Icon=icon, so it is all good.  I guess that Icon=icon.png is perhaps semi deprecated in the DE development world, so new DE's may be moving away from it.  So we can't go wrong with Icon=icon.  2.x will get one final conversion soon also.

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: freedesktop standard for icons and .desktop files.
« Reply #8 on: May 02, 2010, 03:16:59 PM »
Until about 48h ago I did not had the slightest clue about .desktop files. In an attempt to change that I took a look around and stumbled over the fact that on the reference page several links are available:

Why am I boring everybody with those details? One of the small differences between v1.1 (also available as a one page document) is that the example entry has been changed from Icon=fooview.png to Icon=fooview.

Furthermore, I ran a check on the .desktop files in an Ubuntu 09.10 installation: there was no 'Icon=name.ext' entry to be found (they were all like 'Icon=name'). Lets just assume they are compliant with the spec.
« Last Edit: May 02, 2010, 03:21:19 PM by maro »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: freedesktop standard for icons and .desktop files.
« Reply #9 on: May 02, 2010, 05:13:38 PM »
A draft specification is not an official. It is just a draft which can be changed.

I can imagine UBUNTU adjusted all packages to the draft, however if you just download packages in source and compile them, result is a mixture of Icon=xxx.png and Icon=xxx

Key question is the adaptation of the draft by the DE developers. Maybe UBUNTU is strong enough to force application developers to follow it. Anyhow, if you use a certain DE you have to accept its implementation way.

Also, example is one thing. Detailed text:

"Icon to display in file manager, menus, etc. If the name is an absolute path, the given file will be used. If the name is not an absolute path, the algorithm described in the Icon Theme Specification will be used to locate the icon."

It still leaves room for different interpretations.

At the very end question is not what is written in the standard but what and how is implemented in KDE, Gnome, Xfce4, LXDE. You need to adjust your system, your applications to work as expected when used independently what is in the papers :(
« Last Edit: May 02, 2010, 05:22:10 PM by bmarkus »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: freedesktop standard for icons and .desktop files.
« Reply #10 on: May 02, 2010, 09:43:34 PM »
bmarkus: Very valid points. Given my only paper-thin exposure to this matter I should have kept my mouth shut.

I've now had another brief look across a few live ISO images I have available and can confirm that there does not seem to be a strict rule: Knoppix (v6.2) for example has .desktop files with all kind of styles (e.g. "Icon=name", "Icon=local_directory/name.ext", and "Icon=/full/path/name.ext") and they all appear to work well with the default DE (i.e. LXDE, IIRC). Other distributions seem to be a bit "stricter". But as you pointed out it seems to be more a "convention" that is used amongst the developers and extension creators of a given distribution, and not so much a distribution and DE independent "standard".

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: freedesktop standard for icons and .desktop files.
« Reply #11 on: May 02, 2010, 10:47:28 PM »
Given my only paper-thin exposure to this matter I should have kept my mouth shut.

No, I don't think so. Referring to the UBUNTU was a good point showing acceptance of the 1.1-draft standard. :)
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: freedesktop standard for icons and .desktop files.
« Reply #12 on: May 03, 2010, 06:58:29 PM »
For the 2.x repo, the desktop files have been pretty much been converted for all but the Icon=icon thing.

So instead of converting the entire 2.x repo, I will spot fix extensions that are not working with wbar or standard freedesktop DE's or legacy WM's.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: freedesktop standard for icons and .desktop files.
« Reply #13 on: May 09, 2010, 06:26:42 PM »
A second conversion of the 3.x repo is being uploaded, preserving the original desktop files as was in 2.x with the addition of the Icon=icon standard.  Upon spot checking all seems pretty well.

Please list here any extensions that need further attention in regards to multiple menu entries or icons or whatever and it will be addressed.


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14545
Re: freedesktop standard for icons and .desktop files.
« Reply #14 on: May 09, 2010, 08:28:53 PM »
Since bluez works in 3.x, could you convert and upload the blueman extension from the 2.x repo?