如何在 Ubuntu 中注册文件关联 [英] How do I register a file association in Ubuntu
问题描述
我正在创建一个 Ubuntu 安装程序,我需要注册我自己的文件扩展名我找不到任何如何做到这一点的示例.
I'm in the process of creating a Ubuntu Installer and I need to register my own file extension I cant find any examples of how to do this.
人们可以向我提供一些有关如何执行此操作的脚本片段吗?
Could people provide me with some script snippets on how to do this?
注意:我使用 InstallJammer 来帮助我创建安装程序,它允许我调用外部脚本 -所以这就是为什么脚本会是有益的.
NB: Im using InstallJammer to help me create the installer, which allows me to call external scripts - so that is why a script would be beneficial.
推荐答案
InstallJammer 安装程序不能很好地与发行版集成,但这里可以.
An InstallJammer installer won't integrate very well with the distribution, but here goes.
使用 xdg-mime 安装和 xdg-mime 默认设置 mimetype 并关联它.
Use xdg-mime install and xdg-mime default to set up the mimetype and associate it.
这篇关于如何在 Ubuntu 中注册文件关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!