2

我正在尝试让 xdg-open 运行 mplayer 来打开 WMV 文件。

手册说使用 xdg-mime 将文件类型注册为 mime 类型,然后注册 .desktop 文件以打开 mime 类型。

我没有成功注册文件类型:

cam@x ~ $ file toto.wmv 
toto.wmv: Microsoft ASF
cam@x ~ $ xdg-mime query filetype toto.wmv 
application/octet-stream; charset=binary
cam@x ~ $ cat ms-wmv.xml 
<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
<mime-type type="video/x-ms-wmv">
 <comment>video microsoft</comment>
 <glob pattern="*.wmv"/>
</mime-type>
</mime-info>
cam@x ~ $ xdg-mime install ms-wmv.xml 
cam@x ~ $ xdg-mime query filetype toto.wmv 
application/octet-stream; charset=binary
cam@x ~ $

我期待最后一个命令会返回 video/x-ms-wmv。

我错过了什么?

4

1 回答 1

1

你看过:

/usr/share/mime/video

对于相应的 ms-wmv.xml 文件?之后改了吗

xdg-mime install ms-wmv.xml

也许问题来了,执行命令文件保存在~/.local/share/mime中,然后在全局 mime 类型描述中写入:

<sub-class-of type="video/x-ms-asf"/>

也许更改文件/usr/share/mime/video/ms-wmv.xml可以解决问题,或者从全局 mime 目录中删除文件,以便系统开始使用您个人目录中的文件

于 2010-11-09T01:14:47.170 回答