How can I read .desktop files without having to (re)invent the wheel?  Is there a Python or C library that is available in the Ubuntu repos?  Or something with a command line front-end that could be used in any language?

xdg-tools does only installation and validation. pyxdg only returns the strings for each key. I want something higher level corresponding to how it is meant to be used according to the spec, not just a ini-file-parsing library. For example, I want escaping and quoting of %f, %F, %u, %U, and %d etc., of the Exec key, those additional application actions, etc.  I do not want to re-implement (nor read all the details of) the spec, because I am sure there exists some implementation of it already used by GNOME KDE, Ubuntu Unity, etc.

  • Really, it's pretty clear what foo wanted if you recently spent 15 minutes reading .desktop file specifications. Anyone who could provide an answer would understand the intent of the question. – Nobody Sep 16 '16 at 12:47