WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: A little clarification please on ".desktop" usage  (Read 2483 times)

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
A little clarification please on ".desktop" usage
« on: May 11, 2010, 01:11:26 PM »
A little clarification please regarding the use of “.desktop”  files.

I’ll use opera10 as an example which has two “.desktop” files, opera10.desktop  and opera10~1.desktop.

Code: [Select]
opera10.desktop

[Desktop Entry]
Type=Application
Name=Opera_full
Exec=/usr/local/bin/opera
Icon=opera10
X-FullPathIcon=/usr/local/share/pixmaps/opera10.png
Categories=Utility

 
Code: [Select]
opera10~1.desktop

[Desktop Entry]
Type=Application
Name=Opera_browser-only
Exec=/usr/local/bin/opera -nomail -nolirc
Icon=opera10
X-FullPathIcon=/usr/local/share/pixmaps/opera10.png
Categories=Utility

Questions:

1.)   The above files produce a single wbar opera icon labeled “Opera_browser-only”. What is the rule for which “.desktop” entry is used to label the icon?

2.)   How can a separate icon for each “.desktop” file be created?

3.)   The “.desktop” files produce menu entries under a parent menu item labeled opera10 under the Applications main menu item.
a.   What is the rule for what the parent menu item is labeled (opera10)?
b.   What is the rule for what the order is for sub-menu items?
c.   How can a new main menu category be created and used for application extension menu entries?
        For instance "My tools" instead of "Applications".


« Last Edit: May 11, 2010, 01:16:37 PM by bigpcman »
big pc man

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A little clarification please on ".desktop" usage
« Reply #1 on: May 11, 2010, 01:51:55 PM »
Quote
Questions:

1.)   The above files produce a single wbar opera icon labeled “Opera_browser-only”. What is the rule for which “.desktop” entry is used to label the icon?

2.)   How can a separate icon for each “.desktop” file be created?

3.)   The “.desktop” files produce menu entries under a parent menu item labeled opera10 under the Applications main menu item.
a.   What is the rule for what the parent menu item is labeled (opera10)?
b.   What is the rule for what the order is for sub-menu items?
c.   How can a new main menu category be created and used for application extension menu entries?
        For instance "My tools" instead of "Applications".

I setup the "~n.desktop" to  be used to maintain existing submenus in legacy window managers. It is not supported by freedesktop WMs/DEs.

1. Only the "base", i.e, sans ~n.desktop is used for wbar, otherwise wbar would be overrun with duplicate icons. This is how is was deployed in prior 2.x version using JWM/Wbar specifications.

2. Currently not supported for legacy window managers. If separate icons then assumed separate applications. Rememeber we want to maintain support for legacy WMs. Tiny Core is not going to become Tiny Core/LXDE.

3a. If any ~n.desktop is found then the 'base' one is used to create parent menu item.
3b. By the numercial order 1 then 2 then 3 then ...
3c. 'Applications' is a fixed target used by the system, again for legacy WMs. If using a freedesktop supported WM/DE, then you can use the Categories field as defined, supported and deployed by the freedesktop WM/DE, examples see LXDE or XFCE extensions.
« Last Edit: May 11, 2010, 01:53:43 PM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: A little clarification please on ".desktop" usage
« Reply #2 on: May 11, 2010, 03:18:23 PM »
Thank you for the clarification that helped a lot. Just to be sure I understand you:

Quote
1. Only the "base", i.e, sans ~n.desktop is used for wbar, otherwise wbar would be overrun with duplicate icons. This is how is was deployed in prior 2.x version using JWM/Wbar specifications.

I presume you mean by “base”  the file named “appname~1.desktop” as opposed to “appname~2.desktop” or “appname~3.desktop” etc?

Quote
3a. If any ~n.desktop is found then the 'base' one is used to create parent menu item. .

What field in the base “appname~1.desktop” file is used for the menu parent name or is it just the file name itself minus the ~… ?
big pc man

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A little clarification please on ".desktop" usage
« Reply #3 on: May 11, 2010, 03:21:28 PM »
Both cases it is minus the ~...
10+ Years Contributing to Linux Open Source Projects.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: A little clarification please on ".desktop" usage
« Reply #4 on: May 11, 2010, 04:02:29 PM »
Both cases it is minus the ~...

So "base" for opera10 would be "opera10.desktop". But then why does the wbar opera10 icon label and program execution pointer use "opera10~1.desktop" ?

Or am I just a little thick today and missing the point.
« Last Edit: March 28, 2023, 01:18:46 AM by Rich »
big pc man

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: A little clarification please on ".desktop" usage
« Reply #5 on: May 11, 2010, 05:14:33 PM »
When there is multiples...
When talking about  parent menu it is the minus ~..
When talking about wbar ir is the first one ~1.desktop
This is as it was in 2.x.
There the wbar icon was for Opera browser only,
if you wanted the full version you would use the menu.
10+ Years Contributing to Linux Open Source Projects.

Offline bigpcman

  • Hero Member
  • *****
  • Posts: 719
Re: A little clarification please on ".desktop" usage
« Reply #6 on: May 11, 2010, 05:33:13 PM »
When there is multiples...
When talking about  parent menu it is the minus ~..
When talking about wbar ir is the first one ~1.desktop
This is as it was in 2.x.
There the wbar icon was for Opera browser only,
if you wanted the full version you would use the menu.
Thank you.
big pc man