添加 .desktop 文件后,菜单选项不会启动应用程序

添加 .desktop 文件后,菜单选项不会启动应用程序

我正在使用 Lubuntu,并已将文本文件 myapp.desktop 添加到 /usr/share/applications。

我希望该文件启动一个应用程序,但它只启动了 LXTerminal。

这是 myapp.desktop 文件。

[Desktop Entry]
Version=1.0
Name=Sage
Comment=Sage Math
Categories=Development
Exec=/home/tim/Downloads/sage-6.2-x86_64-Linux/sage
Terminal=true
Type=Application
Name[en_US]=Sage Math
GenericName[en_US]=Sage Math
Comment[en_US]=Open Source Math Software

顺便说一句,如果我将应用程序路径输入到 LXTerminal 中,那么应用程序确实可以正确启动。也许我写的文件中遗漏了某些内容?

非常感谢您的帮助。

答案1

为了将来参考,需要将 gksudo 添加到 .desktop 文件中,因为 Java 存在问题,除此之外,这里是在 Lubuntu 中启动 matlab 的最终 .desktop 文件。

#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Icon=/usr/share/icons/matlab.png
Name=MATLAB
Comment=Start MATLAB - The Language of Technical Computing
#Uncomment the following line and comment the line after to
#force matlab to use the 32 bits architecture
#Exec=gksu -u root "/usr/local/MATLAB/R2013a_Student/bin/matlab -arch=glnx86 -desktop"
Exec=gksu -u root "/usr/local/MATLAB/R2013a_Student/bin/matlab -desktop"
Categories=Development;
#Uncomment the following line if you've got several matlab icons in the launcher
#StartupWMClass=com-mathworks-util-PostVMInit

相关内容