understanding desktop (.desktop) application launchers

Forum Forums General Tips and Tricks understanding desktop (.desktop) application launchers

  • This topic has 1 reply, 1 voice, and was last updated Dec 11-1:29 pm by Anonymous.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3607
    Anonymous

      The .desktop mechanism follows a “specification” published by freedesktop.org
      you can read about it, in depth, here

      my TL;DR overview:

      within any .desktop file, as a bare minimum, three lines are needed:
      ( 3 as a practical consideration, not same as stated in the spec )
      Name= labeltext (for the menu entry and/or the desktop icon manager also displays this string)
      Exec= the commandstring to be invoked when launch the application
      Type=Application

      When parsed, each line represents a key : value pair.
      Lines beginning with a # and blank lines are considered comments and will be ignored

      ^—– For a launcher residing directly on desktop, those lines contain sufficient instruction for a “desktop manager” (e.g. rox).
      Additional lines will be (must be) present in order for menumaker to “recognize, and categorize” the launcher, namely:
      Comment= menu hint/onhover description (not all menus display this info)
      Icon= path or alias for the associated iconfile (not all menus display an icon within menu)
      Categories=

      note: Confusingly, the freedesktop.org-spec category “name” (and capitalization) often does not exactly match
      the “category name” localized labeltext displayed within a (icewm, fluxbox, xfce, whisker) desktop menu.

      By convention (practicality, rather than per-spec necessity), the following lines are often specified (by package maintainers) within .desktop files:
      Terminal= value is “false”, unless launching an app which runs inside a terminal shell (implicit false, and this line may be omitted)
      StartupNotify= (implicit false, and this line may be omitted)

      (in)famously, the Guh-nome and KDE packagers will sometimes also declare within the .desktop files they distribute
      OnlyShowIn=
      This serves as an instruction to menumaker scripts/utilities, causing e.g. a “for Gnome” .desktop to be ignored when constructing a menu for other desktop environments.

      FAQ:
      Help! installed programblah, but it’s missing from the menu !
      ^—v
      Check for presence of OnlyShowIn= line and, if found, outcomment (or delete) that line… then regenerate the menu.

      #3608
      Anonymous

        referring back to this

        When parsed, each line represents a key : value pair.

        understand that a “.desktop file” (especially as provided by a package maintainer) may contain extra, or proprietary, keys+values
        Lines starting with X- contain proprietary key:value declarations and
        X-blahblahblah=
        will be ignored by any parser which doesn’t recognize blahblahblah

        MimeType=
        URL=
        ^—– Discussion of these really doesn’t (cannot) fit within this “TL;DR”
        Follow the link above, skim/read the spec, educate yourself…
        and understand that YMMV ~~ not all menumaker utilities (nor window managers, nor desktop icon managers) exactly follow the freedesktop.org spec(s)

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.