.desktop 错误“启动应用程序时出错”

.desktop 错误“启动应用程序时出错”

我需要帮助。尝试创建一个 .desktop 文件:

[Desktop Entry]
Name=Doom 64
Exec=cd "/home/twitch/.wine/drive_c/Program Files (x86)/Doom64" && wine DOOM64.EXE
Icon=/home/twitch/.wine/drive_c/Program Files (x86)/Doom64/doom64.ico
Type=Application
Categories=Wine

但遇到错误(“启动应用程序时出错”)

只需运行命令:

desktop-file-validate Doom64.desktop

返回:

Doom64.desktop: error: value "cd "/home/twitch/.wine/drive_c/Program Files (x86)/Doom64" && wine DOOM64.EXE" for key "Exec" in group "Desktop Entry" contains a reserved character '&' outside of a quote
Doom64.desktop: error: value "cd "/home/twitch/.wine/drive_c/Program Files (x86)/Doom64" && wine DOOM64.EXE" for key "Exec" in group "Desktop Entry" contains a reserved character '&' outside of a quote
Doom64.desktop: error: value "Wine;" for key "Categories" in group "Desktop Entry" contains an unregistered value "Wine"; values extending the format should start with "X-"
Doom64.desktop: hint: value "Wine;" for key "Categories" in group "Desktop Entry" does not contain a registered main category; application might only show up in a "catch-all" section of the application menu

正确的执行方法是什么?

答案1

使其类似:

Exec=sh -c 'cd "/home/twitch/.wine/drive_c/Program Files (x86)/Doom64" && wine DOOM64.EXE'

或者,您可以编写一个脚本并从命令行调用该脚本Exec=。文件的命令行解析器.desktop比 bash 终端提示符要原始得多,并且仅支持解析单个命令及其参数。

相关内容