9

I have a couple of .desktop files that aren't working as expected or not at all. I can't see any error anywhere and asking for help on each one seems unproductive. Is there a way I can verify that I'm using the correct syntax in the file, that it complies with the FreeDesktop standard, so I can apply specific fixes?

16

You are looking for the desktop-file-validate tool provided by the desktop-files-utils package in your distribution. It check for syntax, using reserved words/characters, in summary, that it complies with the Desktop Entry specification. Here's a example of a bad .desktop file:

➜  ~  desktop-file-validate asdf.desktop 
asdf.desktop: error: value "cd /opt/sqldeveloper/sqldeveloper/bin && bash sqldeveloper $*" for key "Exec" in group "Desktop Entry" contains a reserved character '&' outside of a quote
asdf.desktop: error: value "cd /opt/sqldeveloper/sqldeveloper/bin && bash sqldeveloper $*" for key "Exec" in group "Desktop Entry" contains a reserved character '&' outside of a quote
asdf.desktop: error: value "cd /opt/sqldeveloper/sqldeveloper/bin && bash sqldeveloper $*" for key "Exec" in group "Desktop Entry" contains a reserved character '$' outside of a quote
asdf.desktop: error: value "cd /opt/sqldeveloper/sqldeveloper/bin && bash sqldeveloper $*" for key "Exec" in group "Desktop Entry" contains a reserved character '*' outside of a quote
asdf.desktop: hint: value item "GNOME" in key "Categories" in group "Desktop Entry" can be extended with another category among the following categories: GTK
asdf.desktop: error: value "GNOME;Oracle;Utility;Development;" for key "Categories" in group "Desktop Entry" contains an unregistered value "Oracle"; values extending the format should start with "X-"
asdf.desktop: hint: value "GNOME;Oracle;Utility;Development;" for key "Categories" in group "Desktop Entry" contains more than one main category; application might appear more than once in the application menu
asdf.desktop: error: value "s.0.m.t.h.i.n.g" for key "Version" in group "Desktop Entry" is not a known version

Which in good files like caribou-autostart.desktop won't show anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.