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.

closed as unclear what you're asking by jordanm, X Tian, cuonglm, Michael Homer, jimmij Jun 18 '15 at 21:51

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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