开发者

Python: Change default application for specified mime type on Linux

开发者 https://www.devze.com 2023-02-28 22:55 出处:网络
I tried changing default application used to open specified file types using gnomevfs.mime_s开发者_开发技巧et_default_application(mime_type, application_id)

I tried changing default application used to open specified file types using

gnomevfs.mime_s开发者_开发技巧et_default_application(mime_type, application_id)

What I received was this warning: libgnomevfs-WARNING **: Deprecated function. User modifications to the MIME database are no longer supported.

Since I am making a file manager I really need to be able to change this as a part of file/directory properties dialog. Is there a way around it, how Nautilus does this without asking for additional priviledges?


You probably should just invoke xdg-mime from the xdg-utils package. Syntax:

xdg-mime query default mimetype

xdg-mime default application.desktop mimetype
0

精彩评论

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