开发者

Register a filetype association with xdg-mime under Linux

开发者 https://www.devze.com 2023-01-24 02:51 出处:网络
I\'m trying to 开发者_C百科get xdg-open to run mplayer to open WMV files. The manual says to register the filetype with xdg-mime to a mime type, then to register a .desktop file to open the mime type

I'm trying to 开发者_C百科get xdg-open to run mplayer to open WMV files.

The manual says to register the filetype with xdg-mime to a mime type, then to register a .desktop file to open the mime type.

I don't succeed to register the filetype:

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 ~ $

I was expecting the last command would return video/x-ms-wmv.

What am I missing?


Have you looked at:

/usr/share/mime/video

for the corresponding ms-wmv.xml file? is it changed after

xdg-mime install ms-wmv.xml

Perhaps the problem comes that executing the command the file is saved in ~/.local/share/mime and then in the global mime-type description is written:

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

Perhaps changing the file /usr/share/mime/video/ms-wmv.xml will do the trick, or otherwise, removing the file from the global mime dir, in order that the system starts using the one in your personal directory

0

精彩评论

暂无评论...
验证码 换一张
取 消