all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#29472] [patch 0/4] Add perl-file-mimeinfo and dependencies; add it as an input to xdg-utils
@ 2017-11-27 12:50 brendan.tildesley
  2017-11-27 12:54 ` [bug#29472] [PATCH 1/4] gnu: Add perl-file-basedir Brendan Tildesley
  2017-11-28  9:24 ` MIME database Ludovic Courtès
  0 siblings, 2 replies; 13+ messages in thread
From: brendan.tildesley @ 2017-11-27 12:50 UTC (permalink / raw)
  To: 29472

I was wondering why my pdf documents were getting opened in Gimp by default instead of Evince, so I investigated xdg-open and found it uses mimeopen as a fallback, and packaged it. Turns out it didn't make a difference and the issue was simply that the generated mimedata.cache in xdg-mime-database had Gimp listed before Evince.

I was also I little confused that xdg-mime-database produces so many conflicts with shared-mime-info. It's role appears to be to update the data in shared-mime-data and have it overshadow the original data when  conflicts are resolved during profile generation. Looks ugly seeing all those conflicts though.

I had a look at Fedora's version. They just have a single shared-mime-data package that runs update-mime-database, but also they add a few changes to make Evince open pdf's instead of Gimp, among other changes.

This makes me feel that it's desirable for us to also tweak mimedata to make it more sensible -- Pdf's should open in a pdf reader before it opens in an image editor. It seems unrealistic to only tweak upstream projects to make all this mimedata mesh together perfectly to produce ideal default behaviour.

I rambled on a bit too much... Here are some patches that add perl-file-mimeinfo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#29472] [PATCH 1/4] gnu: Add perl-file-basedir.
  2017-11-27 12:50 [bug#29472] [patch 0/4] Add perl-file-mimeinfo and dependencies; add it as an input to xdg-utils brendan.tildesley
@ 2017-11-27 12:54 ` Brendan Tildesley
  2017-11-27 12:54   ` [bug#29472] [PATCH 2/4] gnu: Add perl-file-desktopentry Brendan Tildesley
                     ` (3 more replies)
  2017-11-28  9:24 ` MIME database Ludovic Courtès
  1 sibling, 4 replies; 13+ messages in thread
From: Brendan Tildesley @ 2017-11-27 12:54 UTC (permalink / raw)
  To: 29472

* gnu/packages/perl.scm: (perl-file-basedir): New variable.
---
 gnu/packages/perl.scm | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 73bab96a2..b52d6fd91 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -44,7 +44,8 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages perl-web)
-  #:use-module (gnu packages pkg-config))
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages freedesktop))
 
 ;;;
 ;;; Please: Try to add new module packages in alphabetic order.
@@ -3418,6 +3419,36 @@ files, it will not remove directories; this module remedies that.  It also
 accepts wildcards, * and ?, as arguments for file names.")
     (license (package-license perl))))
 
+(define-public perl-file-basedir
+  (package
+    (name "perl-file-basedir")
+    (version "0.07")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/K/KI/KIMRYAN/"
+                           "File-BaseDir-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0aq8d4hsaxqibp36f773y6dfck7zd82v85sp8vhi6pjkg3pmf2hj"))))
+    (build-system perl-build-system)
+    (native-inputs
+     `(("perl-module-build" ,perl-module-build)
+       ("perl-file-which" ,perl-file-which)
+       ("perl-test-pod" ,perl-test-pod)
+       ("perl-test-pod-coverage" ,perl-test-pod-coverage)
+       ("xdg-user-dirs" ,xdg-user-dirs)))
+    (propagated-inputs
+     `(("perl-ipc-system-simple" ,perl-ipc-system-simple)))
+    (home-page "http://search.cpan.org/dist/File-BaseDir/")
+    (synopsis "Use the Freedesktop.org base directory specification")
+    (description
+     "File::Basedir can be used to find directories and files as specified by
+the Freedesktop.org Base Directory Specification.  This specifications gives a
+mechanism to locate directories for configuration, application data and cache
+data.")
+    (license (package-license perl))))
+
 (define-public perl-file-sharedir
   (package
     (name "perl-file-sharedir")
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#29472] [PATCH 2/4] gnu: Add perl-file-desktopentry.
  2017-11-27 12:54 ` [bug#29472] [PATCH 1/4] gnu: Add perl-file-basedir Brendan Tildesley
@ 2017-11-27 12:54   ` Brendan Tildesley
  2017-11-27 12:54   ` [bug#29472] [PATCH 3/4] gnu: Add perl-file-mimeinfo Brendan Tildesley
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 13+ messages in thread
From: Brendan Tildesley @ 2017-11-27 12:54 UTC (permalink / raw)
  To: 29472

* gnu/packages/perl.scm (perl-file-desktopentry): New variable.
---
 gnu/packages/perl.scm | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index b52d6fd91..bacaaf38a 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -45,7 +45,8 @@
   #:use-module (gnu packages perl-check)
   #:use-module (gnu packages perl-web)
   #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages freedesktop))
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages web))
 
 ;;;
 ;;; Please: Try to add new module packages in alphabetic order.
@@ -3449,6 +3450,33 @@ mechanism to locate directories for configuration, application data and cache
 data.")
     (license (package-license perl))))
 
+(define-public perl-file-desktopentry
+  (package
+    (name "perl-file-desktopentry")
+    (version "0.22")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
+                           "File-DesktopEntry-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1f1maqix2kbfg2rf008m7mqnvv6nvcf9y6pcgdv2kxp2vbih370n"))))
+    (build-system perl-build-system)
+    (native-inputs
+     `(("perl-test-pod" ,perl-test-pod)
+       ("perl-test-pod-coverage" ,perl-test-pod-coverage)))
+    (propagated-inputs
+     `(("perl-file-basedir" ,perl-file-basedir)
+       ("perl-uri" ,perl-uri)))
+    (home-page "http://search.cpan.org/~michielb/File-DesktopEntry/")
+    (synopsis "Handle .desktop files")
+    (description
+     "File::Desktopentry parses .desktop files defined by the Freedesktop.org
+\"Desktop Entry\" specification.  It can also run the applications define in
+those files.")
+    (license (package-license perl))))
+
 (define-public perl-file-sharedir
   (package
     (name "perl-file-sharedir")
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#29472] [PATCH 3/4] gnu: Add perl-file-mimeinfo.
  2017-11-27 12:54 ` [bug#29472] [PATCH 1/4] gnu: Add perl-file-basedir Brendan Tildesley
  2017-11-27 12:54   ` [bug#29472] [PATCH 2/4] gnu: Add perl-file-desktopentry Brendan Tildesley
@ 2017-11-27 12:54   ` Brendan Tildesley
  2017-11-27 12:54   ` [bug#29472] [PATCH 4/4] gnu: xdg-utils: Add perl-file-mimeinfo as an input Brendan Tildesley
  2017-11-28  9:44   ` bug#29472: [PATCH 1/4] gnu: Add perl-file-basedir Ludovic Courtès
  3 siblings, 0 replies; 13+ messages in thread
From: Brendan Tildesley @ 2017-11-27 12:54 UTC (permalink / raw)
  To: 29472

* gnu/packages/perl.scm (perl-file-mimeinfo): New variable.
---
 gnu/packages/perl.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index bacaaf38a..f658b9177 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -46,6 +46,7 @@
   #:use-module (gnu packages perl-web)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages web))
 
 ;;;
@@ -3477,6 +3478,53 @@ data.")
 those files.")
     (license (package-license perl))))
 
+(define-public perl-file-mimeinfo
+  (package
+    (name "perl-file-mimeinfo")
+    (version "0.28")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
+                           "File-MimeInfo-" version ".tar.gz"))
+       (sha256
+        (base32
+         "1ipbh63bkh1r2gy5g7q4bzhki8j29mm1jkhbv60p9vwsdys5s91a"))))
+    (build-system perl-build-system)
+    ;; If the tests are fixed, add perl-test-pod, perl-test-pod-coverage, and
+    ;; perl-test-tiny as native-inputs.
+    (propagated-inputs
+     `(("shared-mime-info" ,shared-mime-info)
+       ("perl-file-desktopentry" ,perl-file-desktopentry)))
+    (arguments
+     ;; Some tests fail due to requiring the mimetype of perl files to be
+     ;; text/plain when they are actually application/x-perl.
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap-programs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (for-each (lambda (prog)
+                           (wrap-program (string-append out "/bin/" prog)
+                             `("PERL5LIB" ":" prefix
+                               (,(string-append (getenv "PERL5LIB") ":" out
+                                                "/lib/perl5/site_perl")))))
+                         '("mimeopen" "mimetype")))
+             #t)))))
+    (home-page "http://search.cpan.org/dist/File-MimeInfo/")
+    (synopsis "Determine file type from the file name")
+    (description
+     "File::Mimeinfo can be used to determine the mime type of a file.  It
+tries to implement the freedesktop specification for a shared MIME database.
+
+ This package also contains two related utilities:
+@itemize
+@item mimetype: Determine a file's mimetype.
+@item mimeopen: Open files in an appropriate program according to their mimetype.
+@end itemize")
+    (license (package-license perl))))
+
 (define-public perl-file-sharedir
   (package
     (name "perl-file-sharedir")
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#29472] [PATCH 4/4] gnu: xdg-utils: Add perl-file-mimeinfo as an input.
  2017-11-27 12:54 ` [bug#29472] [PATCH 1/4] gnu: Add perl-file-basedir Brendan Tildesley
  2017-11-27 12:54   ` [bug#29472] [PATCH 2/4] gnu: Add perl-file-desktopentry Brendan Tildesley
  2017-11-27 12:54   ` [bug#29472] [PATCH 3/4] gnu: Add perl-file-mimeinfo Brendan Tildesley
@ 2017-11-27 12:54   ` Brendan Tildesley
  2017-11-28  9:44   ` bug#29472: [PATCH 1/4] gnu: Add perl-file-basedir Ludovic Courtès
  3 siblings, 0 replies; 13+ messages in thread
From: Brendan Tildesley @ 2017-11-27 12:54 UTC (permalink / raw)
  To: 29472

* gnu/packages/freedesktop.scm (perl-file-mimeinfo)
[input]: Add perl-file-mimeinfo.
---
 gnu/packages/freedesktop.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index cac1f67c5..a830cd93e 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -56,6 +56,7 @@
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages m4)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages polkit)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -85,7 +86,8 @@
        ("w3m" ,w3m)
        ("xmlto" ,xmlto)))
     (propagated-inputs
-     `(("xprop" ,xprop) ; for Xfce detecting
+     `(("perl-file-mimeinfo" ,perl-file-mimeinfo) ; for mimeopen fallback
+       ("xprop" ,xprop) ; for Xfce detecting
        ("xset" ,xset))) ; for xdg-screensaver
     (arguments
      `(#:tests? #f   ; no check target
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* MIME database
  2017-11-27 12:50 [bug#29472] [patch 0/4] Add perl-file-mimeinfo and dependencies; add it as an input to xdg-utils brendan.tildesley
  2017-11-27 12:54 ` [bug#29472] [PATCH 1/4] gnu: Add perl-file-basedir Brendan Tildesley
@ 2017-11-28  9:24 ` Ludovic Courtès
  2017-11-28 10:01   ` julien lepiller
  2017-11-28 10:13   ` Andy Wingo
  1 sibling, 2 replies; 13+ messages in thread
From: Ludovic Courtès @ 2017-11-28  9:24 UTC (permalink / raw)
  To: brendan.tildesley; +Cc: guix-devel

Hello,

(Moving the discussions to guix-devel.)

brendan.tildesley@openmailbox.org skribis:

> I was wondering why my pdf documents were getting opened in Gimp by default instead of Evince, so I investigated xdg-open and found it uses mimeopen as a fallback, and packaged it. Turns out it didn't make a difference and the issue was simply that the generated mimedata.cache in xdg-mime-database had Gimp listed before Evince.

Oh, good catch.  Profile generation is sensitive to package order; so
indeed, if GIMP comes first, it “wins.”

> I was also I little confused that xdg-mime-database produces so many conflicts with shared-mime-info. It's role appears to be to update the data in shared-mime-data and have it overshadow the original data when  conflicts are resolved during profile generation. Looks ugly seeing all those conflicts though.

I guess it’s OK in that users normally don’t want to install these
packages at all, let alone installing both in the same profile.

> I had a look at Fedora's version. They just have a single shared-mime-data package that runs update-mime-database, but also they add a few changes to make Evince open pdf's instead of Gimp, among other changes.
>
> This makes me feel that it's desirable for us to also tweak mimedata to make it more sensible -- Pdf's should open in a pdf reader before it opens in an image editor. It seems unrealistic to only tweak upstream projects to make all this mimedata mesh together perfectly to produce ideal default behaviour.

Right, so I think the immediate course of action here would be to patch
GIMP’s MIME data so that it does not register as a PDF viewer.

If we stumble upon other issues like that, we can fix them similarly.

How does that sound?

Thanks for investigating!

Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#29472: [PATCH 1/4] gnu: Add perl-file-basedir.
  2017-11-27 12:54 ` [bug#29472] [PATCH 1/4] gnu: Add perl-file-basedir Brendan Tildesley
                     ` (2 preceding siblings ...)
  2017-11-27 12:54   ` [bug#29472] [PATCH 4/4] gnu: xdg-utils: Add perl-file-mimeinfo as an input Brendan Tildesley
@ 2017-11-28  9:44   ` Ludovic Courtès
  3 siblings, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2017-11-28  9:44 UTC (permalink / raw)
  To: Brendan Tildesley; +Cc: 29472-done

Hi Brendan,

I applied all 4 patches.  However I took the liberty (1) to add a bit of
@code etc. markup in descriptions, and (2) to move them to
freedesktop.scm so that perl.scm doesn’t pull in all of
freedesktop/gnome.

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: MIME database
  2017-11-28  9:24 ` MIME database Ludovic Courtès
@ 2017-11-28 10:01   ` julien lepiller
  2017-11-28 11:23     ` Alex Vong
  2017-11-28 10:13   ` Andy Wingo
  1 sibling, 1 reply; 13+ messages in thread
From: julien lepiller @ 2017-11-28 10:01 UTC (permalink / raw)
  To: guix-devel

Le 2017-11-28 10:24, ludo@gnu.org a écrit :
> Hello,
> 
> (Moving the discussions to guix-devel.)
> 
> brendan.tildesley@openmailbox.org skribis:
> 
>> I was wondering why my pdf documents were getting opened in Gimp by 
>> default instead of Evince, so I investigated xdg-open and found it 
>> uses mimeopen as a fallback, and packaged it. Turns out it didn't make 
>> a difference and the issue was simply that the generated 
>> mimedata.cache in xdg-mime-database had Gimp listed before Evince.
> 
> Oh, good catch.  Profile generation is sensitive to package order; so
> indeed, if GIMP comes first, it “wins.”
> 
>> I was also I little confused that xdg-mime-database produces so many 
>> conflicts with shared-mime-info. It's role appears to be to update the 
>> data in shared-mime-data and have it overshadow the original data when 
>>  conflicts are resolved during profile generation. Looks ugly seeing 
>> all those conflicts though.
> 
> I guess it’s OK in that users normally don’t want to install these
> packages at all, let alone installing both in the same profile.
> 
>> I had a look at Fedora's version. They just have a single 
>> shared-mime-data package that runs update-mime-database, but also they 
>> add a few changes to make Evince open pdf's instead of Gimp, among 
>> other changes.
>> 
>> This makes me feel that it's desirable for us to also tweak mimedata 
>> to make it more sensible -- Pdf's should open in a pdf reader before 
>> it opens in an image editor. It seems unrealistic to only tweak 
>> upstream projects to make all this mimedata mesh together perfectly to 
>> produce ideal default behaviour.
> 
> Right, so I think the immediate course of action here would be to patch
> GIMP’s MIME data so that it does not register as a PDF viewer.
> 
> If we stumble upon other issues like that, we can fix them similarly.

Thanks for investigating that.

Inkscape also wants to open pdf files ;)

> 
> How does that sound?
> 
> Thanks for investigating!
> 
> Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: MIME database
  2017-11-28  9:24 ` MIME database Ludovic Courtès
  2017-11-28 10:01   ` julien lepiller
@ 2017-11-28 10:13   ` Andy Wingo
  1 sibling, 0 replies; 13+ messages in thread
From: Andy Wingo @ 2017-11-28 10:13 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

On Tue 28 Nov 2017 10:24, ludo@gnu.org (Ludovic Courtès) writes:

> Hello,
>
> (Moving the discussions to guix-devel.)
>
> brendan.tildesley@openmailbox.org skribis:
>
>> I was wondering why my pdf documents were getting opened in Gimp by
>> default instead of Evince, so I investigated xdg-open and found it
>> uses mimeopen as a fallback, and packaged it. Turns out it didn't make
>> a difference and the issue was simply that the generated
>> mimedata.cache in xdg-mime-database had Gimp listed before Evince.
>
> Oh, good catch.  Profile generation is sensitive to package order; so
> indeed, if GIMP comes first, it “wins.”

I had this problem with e.g. Nautilus vs Baobab on directories.
Apparently the right solution is to install a desktop-specific package
that manually does "tie-breaking" for MIME types that have multiple
handlers.  See 96d36f385cb1de83f95dd0404dc2166d6f877389.  You might try
just installing gnome-default-applications, or we might have a similar
package.

Andy

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: MIME database
  2017-11-28 10:01   ` julien lepiller
@ 2017-11-28 11:23     ` Alex Vong
  2017-11-28 12:57       ` Andy Wingo
  0 siblings, 1 reply; 13+ messages in thread
From: Alex Vong @ 2017-11-28 11:23 UTC (permalink / raw)
  To: julien lepiller; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2296 bytes --]

julien lepiller <julien@lepiller.eu> writes:

> Le 2017-11-28 10:24, ludo@gnu.org a écrit :
>> Hello,
>>
>> (Moving the discussions to guix-devel.)
>>
>> brendan.tildesley@openmailbox.org skribis:
>>
>>> I was wondering why my pdf documents were getting opened in Gimp by
>>> default instead of Evince, so I investigated xdg-open and found it
>>> uses mimeopen as a fallback, and packaged it. Turns out it didn't
>>> make a difference and the issue was simply that the generated
>>> mimedata.cache in xdg-mime-database had Gimp listed before Evince.
>>
>> Oh, good catch.  Profile generation is sensitive to package order; so
>> indeed, if GIMP comes first, it “wins.”
>>
>>> I was also I little confused that xdg-mime-database produces so
>>> many conflicts with shared-mime-info. It's role appears to be to
>>> update the data in shared-mime-data and have it overshadow the
>>> original data when  conflicts are resolved during profile
>>> generation. Looks ugly seeing all those conflicts though.
>>
>> I guess it’s OK in that users normally don’t want to install these
>> packages at all, let alone installing both in the same profile.
>>
>>> I had a look at Fedora's version. They just have a single
>>> shared-mime-data package that runs update-mime-database, but also
>>> they add a few changes to make Evince open pdf's instead of Gimp,
>>> among other changes.
>>>
>>> This makes me feel that it's desirable for us to also tweak
>>> mimedata to make it more sensible -- Pdf's should open in a pdf
>>> reader before it opens in an image editor. It seems unrealistic to
>>> only tweak upstream projects to make all this mimedata mesh
>>> together perfectly to produce ideal default behaviour.
>>
>> Right, so I think the immediate course of action here would be to patch
>> GIMP’s MIME data so that it does not register as a PDF viewer.
>>
>> If we stumble upon other issues like that, we can fix them similarly.
>
> Thanks for investigating that.
>
> Inkscape also wants to open pdf files ;)
>
On my laptop, the recommended programs include evince, libreoffice draw,
gimp, inkscape, imagemagick and winebrowser. I am not running guixsd
though.

>>
>> How does that sound?
>>
>> Thanks for investigating!
>>
>> Ludo’.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: MIME database
  2017-11-28 11:23     ` Alex Vong
@ 2017-11-28 12:57       ` Andy Wingo
  2017-11-30  9:54         ` Ludovic Courtès
  2017-12-01 15:05         ` Ludovic Courtès
  0 siblings, 2 replies; 13+ messages in thread
From: Andy Wingo @ 2017-11-28 12:57 UTC (permalink / raw)
  To: Alex Vong; +Cc: guix-devel

On Tue 28 Nov 2017 12:23, Alex Vong <alexvong1995@gmail.com> writes:

> julien lepiller <julien@lepiller.eu> writes:
>
>> Le 2017-11-28 10:24, ludo@gnu.org a écrit :
>>> brendan.tildesley@openmailbox.org skribis:
>>>
>>> Right, so I think the immediate course of action here would be to patch
>>> GIMP’s MIME data so that it does not register as a PDF viewer.
>>>
>>> If we stumble upon other issues like that, we can fix them similarly.
>>
>> Thanks for investigating that.
>>
>> Inkscape also wants to open pdf files ;)
>>
> On my laptop, the recommended programs include evince, libreoffice draw,
> gimp, inkscape, imagemagick and winebrowser. I am not running guixsd
> though.

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: MIME database
  2017-11-28 12:57       ` Andy Wingo
@ 2017-11-30  9:54         ` Ludovic Courtès
  2017-12-01 15:05         ` Ludovic Courtès
  1 sibling, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2017-11-30  9:54 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1887 bytes --]

Andy Wingo <wingo@igalia.com> 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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 803 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 268 bytes --]


> 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’.

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: MIME database
  2017-11-28 12:57       ` Andy Wingo
  2017-11-30  9:54         ` Ludovic Courtès
@ 2017-12-01 15:05         ` Ludovic Courtès
  1 sibling, 0 replies; 13+ messages in thread
From: Ludovic Courtès @ 2017-12-01 15:05 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guix-devel

Andy Wingo <wingo@igalia.com> skribis:

> Specifically we should add to this package from gnome.scm to include the
> PDF -> evince association:

I’ve just done that:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=8ad4f0aa315d69ff6b2df50e21ef01a60b0d2aec

Ludo’.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-12-01 15:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 12:50 [bug#29472] [patch 0/4] Add perl-file-mimeinfo and dependencies; add it as an input to xdg-utils brendan.tildesley
2017-11-27 12:54 ` [bug#29472] [PATCH 1/4] gnu: Add perl-file-basedir Brendan Tildesley
2017-11-27 12:54   ` [bug#29472] [PATCH 2/4] gnu: Add perl-file-desktopentry Brendan Tildesley
2017-11-27 12:54   ` [bug#29472] [PATCH 3/4] gnu: Add perl-file-mimeinfo Brendan Tildesley
2017-11-27 12:54   ` [bug#29472] [PATCH 4/4] gnu: xdg-utils: Add perl-file-mimeinfo as an input Brendan Tildesley
2017-11-28  9:44   ` bug#29472: [PATCH 1/4] gnu: Add perl-file-basedir Ludovic Courtès
2017-11-28  9:24 ` MIME database Ludovic Courtès
2017-11-28 10:01   ` julien lepiller
2017-11-28 11:23     ` Alex Vong
2017-11-28 12:57       ` Andy Wingo
2017-11-30  9:54         ` Ludovic Courtès
2017-12-01 15:05         ` Ludovic Courtès
2017-11-28 10:13   ` Andy Wingo

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.