Years later, I've made a small utility that scans MIME database (both system and user) and register all known native mime-types in Windows registry.
It uses xdg-open
to open a file if there is a default (native) application for that
mime type, otherwise uses packagekit
to search for a package that can handle
that file (just like what Nautilus does). So my initial requirement of registering only extensions that have an installed, native application was not needed anymore. However, an early version of the script did filter only such types. The snippet that made it possible was:
perl -e '
use strict; use warnings;
use File::MimeInfo::Magic; use File::MimeInfo::Applications;
while (my $line = <STDIN>) {
chomp($line);
my ($ext, $mime) = (split/\t/, $line);
my ($def, @apps) = mime_applications_all($mime);
print "$line\n" if ($def || @apps)
}'
By default my script only registers native types that have no handler in windows
registry, but it can also override such associations (so, for example, jpeg
files are opened in native viewer instead of the default Gecko wine browser).
It can also ignore some extensions even if they have no handler in windows.
It tries its best to be winemenubuilder-friendly, meaning all associations it
creates is not published as native associations (or as x-wine-extension
mimetypes) by winemenubuilder, which would be ugly and potentially cause loops.
This is very tricky and not yet perfect, specially with mixed-case extensions
(.C and .c for example)
That said, I hope this script is helful for everyone:
https://github.com/MestreLion/wine-tools/blob/master/wine-import-extensions
Improvements welcome!
Here is a workaround for the Firefox problem from Canonical support:
1) stop firefox
2) rm ~/.mozilla/firefox//mimeTypes.rdf
3) start firefox
4) download a file
5) open it from the downloads menu and choose the application. Browse to /usr/bin /xdg-open. then check to remember your choice
Now both open and open containing folder should work. You can then change the preferred programs through kde's file associations settings.
NOTE: I have confirmed that this solution works. It's a workaround, but in some ways it is an improvement over the original Firefox approach (for KDE users).
Regarding Rekonq, I was in the kubuntu-devel IRC channel recently speaking to a developer. He said he was putting through a fix for the Rekonq issue. I believe it is in place now. I'm told that that after 'apt-get upgrade rekonq' has been run on Kubuntu 12.04 beta1 that this Rekonq bug is gone. EDIT: yes, I have confirmed this fix too.
Best Answer
Copy the desktop file from
/usr/share/applications/
to~/.local/share/applications/
and modify as needed.Just remove some entries in MimeType
Afterwards restart session.