English 中文(简体)
How do I register a file association in 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?

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.

最佳回答

An InstallJammer installer won t integrate very well with the distribution, but here goes.

Use xdg-mime install and xdg-mime default to set up the mimetype and associate it.

问题回答

The recommended way is to write an ubuntu package, for example with CDBS (overview, docs, examples, bonus non-cdbs tutorial).

Then you add $PACKAGE.sharedmimeinfo and $APPNAME.desktop files in the debian/ directory. The sharedmimeinfo file describes the file type, the desktop file describes your app. The latter should contain a MimeType=application/x-$APPNAME; that matches the filetype.





相关问题
Add a changing icon to Ubuntu Panel

What would be the most simple way of adding and changing an icon in the Ubuntu (Gnome) Panel? I m looking for something as simple as shell scripting, but I m not restricted to that. Will write a ...

Configuring kernel

After create a new system call, how to update the kernel? I tried these lines, make-kpkg clean fakeroot make-kpkg -initrd -append-to-version=-custom kernel_image kernel_headers But Ubuntu asked me ...

save Exceptions to file in python

I want to save all following Exceptions in a file. The reason why I need this is because the IDLE for python 3.1.1 in Ubuntu raises an Exception at calltipps, but close to fast, that it isn t readble. ...

How can i monitor system statistics in kubuntu using Java?

i am doing a project related to configuration and memory analyzer for kubuntu. i want to display the system statistics information like CPU usage, RAM usage and proceses etc. graphically using an ...

How to pass "--external-locking" for mysqld in Ubuntu

I would like to start my mysql server with the --external-locking option. As mysqld is run by the /etc/init.d/mysql script ubuntu (karmic), I guess that s where I should set this "--external-locking" ...

"g++" and "c++" compiler

I just found on my Ubuntu, there are two different C++ compilers: /usr/bin/g++ and /usr/bin/c++. I am not familiar with the latter, but man c++ just jumps to the manpage of gcc. I wonder what is their ...

热门标签