安装idea后,新建桌面快捷方式,然而ubuntu 20.04中,在文件管理中 双击.desktop文件 变为了 使用文本编辑器打开,而不是打开.desktop对应的应用程序。
[Desktop Entry]
Name=Idea2021
Comment=Idea Studio
Exec=/usr/local/ide/idea-IU-211.7628.21/bin/idea.sh
Icon=/usr/local/ide/idea-IU-211.7628.21/bin/idea.png
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Development;
多番尝试,综合评比效果,采用以下方案:
新建一个桌面快捷方式文件 xxxxxx.desktop,内如参见本文开篇文字,在终端命令行中通过命令 ./xxxxxx.desktop 能打开该应用程序,但是直接鼠标双击变为了使用文本编辑器打开,这不是想要的结果。
解决方法
方法一:
在ubuntu 20.04中要想双击打开只能建立桌面图标。
把.desktop 文件复制到桌面,然后鼠标右键,选择 允许启动 。现在 图标就显示正常了,而且可以双击打开了。
但是这种方法 桌面图标不能添加到dock中的收藏夹。

参考:
Nautilus no longer allows the launching of .desktop files thru it. (nautilus)
The only way to double click > launch is to have the .desktop file on your Desktop. Even then you'll need to set it to allow launching, likely thru the right click context menu.
Other file managers such as nemo aren't encumbered in this regard.
方法二:
复制.desktop 文件到自己主目录下的 /usr/local/share/applications 这样 在应用程序中就能找到该 应用程序图标了,就能鼠标点击打开了。
而且该应用程序能添加到dock的收藏夹。

参考:
https://askubuntu.com/questions/1187934/cannot-launch-desktop-files-opens-with-text-editor-instead
Add the .desktop file inside the ~/.local/share/applications and then it will appear in the App launcher, so you can add it to the Dock (add to favorites) and copy to the Desktop folder to add to Desktop.
Ubuntu 20.04:如何修复.desktop文件双击不执行问题
本文介绍了解决Ubuntu 20.04系统中双击.desktop文件无法正常启动应用程序的问题,提供了两种方法:一是将.desktop文件放置于桌面并设置允许启动,二是将其放入/usr/local/share/applications以实现桌面图标和Dock的收藏夹支持。
1448

被折叠的 条评论
为什么被折叠?



