associating files with same MIME but different file extensions to differentt applications
I strove to make Firefox ⟷ maff association only for one user (me). So I didn't touch files under /etc
.
I did the following:
Restore correct association between ZIP-files and archive manager (I did it within default file manager Nemo).
-
Create definition of MIME type. In my case I created
firefox-maff-my.xml
file in~/.local/share/mime/packages
directory with the content provided below:<?xml version="1.0" encoding="UTF-8"?> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="application/maff"> <comment>Mozilla Archive Format</comment> <glob pattern="*.maff"/> </mime-type> </mime-info>
-
Update MIME database
update-mime-database ~/.local/share/mime/
-
Edit
~/.local/share/applications/mimeapps.list
. Addapplication/maff=firefox.desktop
line right under
[Default Applications]
. Log out, then log in.
In case of doubts you can make backup of each involved file before editing it. If something will go wrong you can revert everything you did (just restore original files, remove firefox-maff-my.xml
and run update-mime-database ~/.local/share/mime/
again).
I've faced similar issue in Linux Mint 17.1 Cinnamon. Perhaps this also will work for GNOME (because both follow freedesktop.org).
As of 2016/Feb/20, this is the correct solution to associate MAFF files to Firefox (or any other files), without affecting the Compressed archive/ZIP association:
# run as sudo
echo '<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-maff">
<comment>Maff File</comment>
<glob pattern="*.maff"/>
</mime-type>
</mime-info>' > /usr/share/mime/packages/maff.xml
update-mime-database /usr/share/mime
# now kill X or logout.
The assogiate
solution is not valid anymore, as the package has been removed from the Ubuntu repositories after v14.04.
Simple way to do this is by using mimeopen
command to open .maff file format using Firefox
Open terminal and type
mimeopen some_file_name.maff
You will be provided with available packages to open the .maff file
Please choose a default application for files of type application/zip
1) Archive Manager (file-roller)
2) Archive Mounter (mount-archive)
3) Other...
select 3 from the option and enter the command as firefox
use application #3
use command: firefox
This will open up .maff file in Firefox and will be set as default program to open .maff file