[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MIME database
From: |
brendan . tildesley |
Subject: |
Re: MIME database |
Date: |
Wed, 29 Nov 2017 09:12:41 -0000 |
User-agent: |
OpenMailBox Webmail |
> On Tue 28 Nov 2017 12:23, Alex Vong <address@hidden> writes:
>
>> julien lepiller <address@hidden> writes:
>>
>>> Le 2017-11-28 10:24, address@hidden a écrit :
>>>> address@hidden skribis:
>>>>
[...]
>
> I think it's reasonable to want to be able to open PDFs in inkscape or
> GIMP (e.g. via the "Open With" menu in a file browser like Nautilus),
> just that they shouldn't be the default option. I think removing the
> association would be a not-so-good option; the blessed way to fix this
> is apparently to install a set of defaults.
>
> Specifically we should add to this package from gnome.scm to include the
> PDF -> evince association:
>
> (define-public gnome-default-applications
> (package
> (name "gnome-default-applications")
> (version "0")
> (build-system trivial-build-system)
> (source #f)
> (propagated-inputs
> `(("nautilus" ,nautilus)))
> (arguments
> `(#:modules ((guix build utils))
> #:builder
> (begin
> (use-modules (guix build utils))
> (let* ((out (assoc-ref %outputs "out"))
> (apps (string-append out "/share/applications")))
> (mkdir-p apps)
> (call-with-output-file (string-append apps "/defaults.list")
> (lambda (port)
> (format port "[Default Applications]\n")
> (format port
> "inode/directory=org.gnome.Nautilus.desktop\n")))
> #t))))
> (synopsis "Default MIME type associations for the GNOME desktop")
> (description
> "Given many installed packages which might handle a given MIME type,
> a
> user running the GNOME desktop probably has some preferences: for example,
> that folders be opened by default by the Nautilus file manager, not the
> Baobab
> disk usage analyzer. This package establishes that set of default MIME
> type
> associations for GNOME.")
> (license license:gpl3+)
> (home-page #f)))
>
> Possibly we could have a set of defaults for XFCE as well. See also
> https://wiki.archlinux.org/index.php/default_applications#XDG_standard.
>
> Andy
That wiki points to
https://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html
I stumbled across this thread
https://mail.gnome.org/archives/distributor-list/2015-January/msg00000.html
That claims defaults.list is deprecated.
Following the latest spec, gnome-default applications should create
mimeapps.list instead of defaults.list, or perhaps gnome-mimeapps.list, which
will then be used if XDG_CURRENT_DESKTOP=GNOME .
With {gnome,xcfe,...]-mimeapps.list, multiple non-conflicting mimeapps.list
files can be installed and used appropriately when one logs in to a particular
desktop environment.
Why does gnome-default-applications have nautilus as a propagated-input? I'd
have expected such a package to merely install the mimedata and do nothing
else. And currently it just installs one line for nautilus.
Fedora-Workstation has the file
http://pkgs.fedoraproject.org/cgit/rpms/shared-mime-info.git/tree/gnome-mimeapps.list
as a part of "shared-mime-data". When I launched Fedora in VM, I found it also
has this identical file at
/usr/share/applications/mimedata.list
as well ass
/usr/share/applications/gnome-mimedata.list
I'm not sure why they chose to do that.
I'm wondering what people like me who use tiling window managers should do.
Should we install such a file and set XDG_CURRENT_DESKTOP=GNOME to get the
benefit of GNOME defaults? But then mixing applications from multiple desktops
becomes an issue.
The thing I want to achieve is good *defaults*, but installing such things and
setting a variable directly contradicts that. This implies the solution
probably ought to involve modifying shared-mime-info or xdg-mime-database such
that the resulting mime data generated by update-mime-database embeds these
common-sense defaults like preferring Evince/Okular over Gimp for PDF files.
The mime-apps specs even labels the system installed mimeapps.list files as
"distribution-provided defaults" suggesting that it is the role of distribution
developers to manipulate these files as they see fit to produce good defaults.
Although, how would one do it without making Okular appear in the list of
applications even when it is not actually installed? I'll have to investigate
how update-mime-database works.