我有几个.desktop
文件没有按预期工作或根本没有工作。我在任何地方都看不到任何错误,并且在每个错误上寻求帮助似乎没有成效。有没有办法可以验证我在文件中使用的语法是否正确,是否符合 FreeDesktop 标准,以便我可以应用特定的修复程序?
答案1
您正在寻找desktop-file-validate
由桌面文件实用程序包在你的发行版中。它使用保留字/字符检查语法,总之,它符合桌面输入规格。下面是一个错误的 .desktop 文件的示例:
➜ ~ 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
在好的文件中,caribou-autostart.desktop
不会显示任何内容。