使用自定义命令的文件/应用程序关联消失了?

在以前的Ubuntus中,当您要选择/更改应用程序以打开特定文件(右键单击/打开其他应用程序或属性)时,您可以编写自定义命令来打开该文件。 这非常有用,但现在在11.10我找不到这个选项,它只显示了一个应用程序列表和一个在Internet中查找应用程序的按钮。

有没有办法恢复命令行来编写自定义命令来打开文件?

正如我在http://blog.whatgeek.com.pt/?p=319上找到的那样,您可以使用mimeopen -d /path/to/file在cli上配置自定义应用程序。 它将由gnome3使用。

 $ mimeopen -d foo.matroska Please choose a default application for files of type application/x-matroska 1) VLC media player (vlc) 2) Banshee (banshee) 3) Movie Player (totem) 4) Other... use application #4 use command: mplayer Opening "foo.matroska" with mplayer (application/x-matroska) 

我已经煮熟了这个小脚本,允许我们的用户使用他们选择的程序打开一个文件。

https://github.com/gecos-team/openwith

该套餐包括:

1)一个小shell脚本,提示您选择二进制文件(使用简单的Zenity对话框)。 该脚本应命名为/ usr / bin / openwith

 #/ bin / sh的

默认为 “在/ usr /斌/”

 FILE =`zenity --file-selection --filename = $ DEFAULT --title =“打开...”

案件$? 在
          0)
                 “$ FILE”“$ 1”;;

 ESAC

2) openwith.desktop文件必须放在/ usr / share / applications /中,以便在Nautilus中右键单击文件时选择“openwith”。

 [桌面入口]
版本= 1.0
类型=应用
终端=假
图标=应用程序的默认图标
姓名=您选择的计划......
姓名[es_ES] = un programa elegir ...
 Comment =使用所选程序打开文件
评论[es_ES] = Abre un archivo con el programa seleccionado
 Exec = / usr / bin / openwith%f

扩展这个想法,尝试为mimeopen -a和mimeopen -d命令创建.desktop文件。 这将恢复通过自定义命令打开到正确的上下文菜单的能力,虽然你必须在菜单中挖掘一下才能得到它。

安装Thunar文件管理器,Thunar中仍然存在自定义命令。

要安装Thunar,只需在ubuntu软件中心进行搜索即可。

(由lebatsnok编辑)Thunar包含在xfce中 – 因此它在xfce桌面中默认工作。 如果你想让thunar成为你的默认文件管理器但继续使用另一个destop,那么以下链接将为你提供一些想法。 安装thunar应该像以下一样简单:

 sudo apt-get update sudo apt-get install thunar --no-install-recommends 
  • 假设你不想要xfce。