guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MIME database


From: Ludovic Courtès
Subject: Re: MIME database
Date: Thu, 30 Nov 2017 10:54:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Andy Wingo <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)))

Like this?

diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 9a46495f1..34ecb5e05 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5882,7 +5882,9 @@ software that do not provide their own configuration 
interface.")
            (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")))
+               (format port "inode/directory=org.gnome.Nautilus.desktop\n")
+               (format port "application/pdf=evince.desktop\n")
+               (format port "application/postscript=evince.desktop\n")))
            #t))))
     (synopsis "Default MIME type associations for the GNOME desktop")
     (description
> Possibly we could have a set of defaults for XFCE as well.  See also
> https://wiki.archlinux.org/index.php/default_applications#XDG_standard.

Indeed.

I’m surprised upstream GNOME and Xfce don’t provide a ‘default.list’
file.

Thanks,
Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]