Re: Fixing the mime horror ini Debian
Hi Josselin,
On Fr, 13 Jul 2012, Josselin Mouette wrote:
> The freedesktop MIME system (which applies for GNOME, Xfce and LXDE)
> allows to specify defaults for every given MIME type. However, it is
> not realistic to agree in Debian as a whole on a set of defaults.
But why doesn't it work not even in gnome?
> This is why GNOME sets default associations for GNOME sessions: this is
> the /etc/gnome/defaults.list file. Therefore the behavior you describe
lists application/pdf=evince.desktop
> should not happen in a GNOME session – unless you start it through a
> custom .xsession.
>
> That’s for GNOME.
Ok, I am talking about starting the default GNOME session from a gdm3.
That is booting into the system, waiting to gdm3 to appear, selecting
GNOME from the dropdown list, type in my name and password and go.
I don't know what that means, but I expect it to work.
I digged into the guts and I *cannot* find any reasonalb explanation:
- all defaults are set to evince
- xdg-mime query gives me evince
- straceing gvfs-open and checking all opened files I only see proper
application/pdf entries pointint to evince
But: If I do:
python -c 'import gio; f = gio.File("file:/home/norbert/foo.pdf");print f.query_default_handler();'
I get:
<gio.unix.DesktopAppInfo at 0x7ff914c3b910: File Manager>
uggg.
When I do something similar with perl I get a bit more information,
namely that it seems that there is no default?
$ cat testmime.pl
use strict;
use File::MimeInfo;
use File::MimeInfo::Applications;
my $mime_type = mimetype("/home/norbert/foo.pdf");
print "mime type = $mime_type\n";
my ($default, @other) = mime_applications($mime_type);
if (defined($default)) {
print "default name ".$default->Name."\n";
} else {
if (@other) {
for my $o (@other) {
print "other name ".$o->Name."\n";
}
} else {
print "no default found!\n";
}
}
Running that I get:
mime type = application/pdf
other name xpdf
other name ePDFViewer
other name GNU Image Manipulation Program
other name GNU Image Manipulation Program
other name Adobe Reader 9
other name TeXworks
other name PDF Mod
other name Zathura
other name xpdf
other name MuPDF
other name Document Viewer
other name gv
other name qpdfview
but no default
So *how* should I set this if it is already mentioned in
/etc/gnome/defaults.list
/usr/share/gnome/applications/defaults.list
?
Best wishes
Norbert
------------------------------------------------------------------------
Norbert Preining preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan TeX Live & Debian Developer
DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
PLEELEY (adj.)
Descriptive of a drunk person's attempt to be endearing.
--- Douglas Adams, The Meaning of Liff
Reply to: