ubuntu 20.04 不能鼠标双击打开 .desktop (桌面快捷方式图标)文件(双击变为使用文本编辑器打开)的解决办法

经测试ubuntu 18.04 可以双击打开 .desktop文件

然而ubuntu 20.04中,在文件管理中 双击.desktop文件 变为了 使用文本编辑器打开,而不是打开.desktop对应的应用程序。

有一个桌面快捷方式文件 xxxxxx.desktop,在终端中通过命令 ./xxxxxx.desktop 能打开该应用程序,但是直接鼠标双击变为了使用文本编辑器打开,这不是我们想要的结果。

方法一:

在ubuntu 20.04中要想双击打开只能建立桌面图标。

把.desktop 文件复制到桌面,然后鼠标右键,选择 允许启动 。现在 图标就显示正常了,而且可以双击打开了。

但是这种方法 桌面图标不能添加到dock中的收藏夹。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-cEsBDMgv-1614741711094)(https://www.pianshen.com/images/729/0a6a8c5f5897634e2635f48c2a64ebe1.png)]

参考:

https://askubuntu.com/questions/1158715/desktop-files-not-executing-via-double-click-only-from-terminal?rq=1

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 文件到自己主目录下的 ~/.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.

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值