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; 17+ 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] 17+ messages in thread
* Re: MIME database
@ 2017-11-29  8:19 brendan.tildesley
  0 siblings, 0 replies; 17+ messages in thread
From: brendan.tildesley @ 2017-11-29  8:19 UTC (permalink / raw)
  To: ludo

ludo@gnu.org (Ludovic Courtès) writes:

> Hello,
>
> (Moving the discussions to guix-devel.)
>
> brendan.tildesley@openmailbox.org skribis:
>
[...]
>> 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?
>
Well, in my interpretation, the mime data just says that it's can handle PDF's, not necessarily that it's at PDF reader. If a PDF is opened with Gimp, it shows an interface for importing it as images, so I don't feel like it's a mistake for Gimp to mark it's self as being able to handle PDF's. If we make actual PDF readers have priority over Gimp somehow, Gimp will still be under the list of suggested applications when one right clicks on a *.pdf file in a file manager, but making this change would completely remove Gimp as an option. 

From the perspective of Gimp developers, they have no power to make Gimp's mimedata cause ideal behaviour on, because mimedata is simply not very versatile, so listing Gimp as being able to handle application/pdf isn't a mistake on their part.

The best solution might be to create mimeapps.list files that take precedence over mimeinfo.cache. I'm not sure which package it should go in though.

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: MIME database
@ 2017-11-29  9:12 brendan.tildesley
  0 siblings, 0 replies; 17+ messages in thread
From: brendan.tildesley @ 2017-11-29  9:12 UTC (permalink / raw)
  To: Andy Wingo

> 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:
>>>>
[...]
> 
> 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.

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: MIME database
@ 2017-11-29 11:49 brendan.tildesley
  0 siblings, 0 replies; 17+ messages in thread
From: brendan.tildesley @ 2017-11-29 11:49 UTC (permalink / raw)
  To: guix-devel

(Apparently I replied only to ludo but not the mailing list by accident, so I'm sending this again)

ludo@gnu.org (Ludovic Courtès) writes:

> Hello,
>
> (Moving the discussions to guix-devel.)
>
> brendan.tildesley@openmailbox.org skribis:
>
[...]
>> 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?
>
Well, in my interpretation, the mime data just says that it's can handle PDF's, not necessarily that it's at PDF reader. If a PDF is opened with Gimp, it shows an interface for importing it as images, so I don't feel like it's a mistake for Gimp to mark it's self as being able to handle PDF's. If we make actual PDF readers have priority over Gimp somehow, Gimp will still be under the list of suggested applications when one right clicks on a *.pdf file in a file manager, but making this change would completely remove Gimp as an option. 

From the perspective of Gimp developers, they have no power to make Gimp's mimedata cause ideal behaviour on, because mimedata is simply not very versatile, so listing Gimp as being able to handle application/pdf isn't a mistake on their part.

The best solution might be to create mimeapps.list files that take precedence over mimeinfo.cache. I'm not sure which package it should go in though.

^ permalink raw reply	[flat|nested] 17+ messages in thread
* Re: MIME database
@ 2017-11-29 11:51 brendan.tildesley
  0 siblings, 0 replies; 17+ messages in thread
From: brendan.tildesley @ 2017-11-29 11:51 UTC (permalink / raw)
  To: guix-devel

(Apparently I replied only to Andy but not the mailing list by accident, so I'm sending this again)
> 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:
>>>>
[...]
> 
> 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.

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

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

Thread overview: 17+ 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
  -- strict thread matches above, loose matches on Subject: below --
2017-11-29  8:19 brendan.tildesley
2017-11-29  9:12 brendan.tildesley
2017-11-29 11:49 brendan.tildesley
2017-11-29 11:51 brendan.tildesley

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.