Discussion:
New `MimeType` fields in .desktop
David Faure
2021-05-03 09:58:54 UTC
Permalink
The order for mime-types with no defaults has nothing to do with a
"shared database", it's implementation specific, as it's not codified
in the mime specs. GLib probably behaves differently than Qt does,
which means that the file managers using either of those are likely to
behave differently.
Qt's native support for opening files in accordance with XDG is to
invoke /usr/bin/xdg-open.
The actual code for choosing preferred applications for a mimetype, in the Qt/
KDE world, isn't in Qt, but in KDE Frameworks (KService).

I'm late to this thread, but before we talk about adding even more complexity
to the solution of choosing an app for a mimetype, I'd like to understand why
https://specifications.freedesktop.org/mime-apps-spec/latest/
doesn't solve the issue. If the distro's mimeapps.lst says
image/jpeg=gwenview.desktop;gimp.desktop;
then JPEG files will be opened in gwenview (if installed) rather than in GIMP,


PS: the above link points to an out of date version of the spec, does anyone
know how to fix the setup so that the mapping from web-export/specs.idx
actually ends up on the website?
Has this been updated with the move to gitlab?
--
David Faure, ***@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
Thomas Kluyver
2021-05-03 10:57:36 UTC
Permalink
Post by David Faure
I'd like to understand why
https://specifications.freedesktop.org/mime-apps-spec/latest/
doesn't solve the issue. If the distro's mimeapps.lst says
image/jpeg=gwenview.desktop;gimp.desktop;
then JPEG files will be opened in gwenview (if installed) rather than in GIMP,
I think this is all about the case where no mimeapps.list gives any preferred application for the mimetype - how should the launcher choose a default default application.

Of course, one answer is to say that part of the distro's role is defining default preferences in a mimeapps.lst so this doesn't come up, but there will always be cases it doesn't cover.

Thomas
Jehan Pagès
2021-05-03 11:17:57 UTC
Permalink
Hi!
Post by David Faure
The order for mime-types with no defaults has nothing to do with a
"shared database", it's implementation specific, as it's not codified
in the mime specs. GLib probably behaves differently than Qt does,
which means that the file managers using either of those are likely to
behave differently.
Qt's native support for opening files in accordance with XDG is to
invoke /usr/bin/xdg-open.
The actual code for choosing preferred applications for a mimetype, in the Qt/
KDE world, isn't in Qt, but in KDE Frameworks (KService).
I'm late to this thread, but before we talk about adding even more complexity
to the solution of choosing an app for a mimetype, I'd like to understand why
https://specifications.freedesktop.org/mime-apps-spec/latest/
doesn't solve the issue. If the distro's mimeapps.lst says
image/jpeg=gwenview.desktop;gimp.desktop;
then JPEG files will be opened in gwenview (if installed) rather than in GIMP,
These are defaults or user customization. It's nice but cannot be
exhaustive by definition. It won't ever take into account all software.
And more to the point: it doesn't talk/handle at all about intent which is
the whole point of this thread.

Jehan
Post by David Faure
PS: the above link points to an out of date version of the spec, does anyone
know how to fix the setup so that the mapping from web-export/specs.idx
actually ends up on the website?
Has this been updated with the move to gitlab?
--
Working on KDE Frameworks 5
_______________________________________________
xdg mailing list
https://lists.freedesktop.org/mailman/listinfo/xdg
--
ZeMarmot open animation film
http://film.zemarmot.net
Liberapay: https://liberapay.com/ZeMarmot/
Patreon: https://patreon.com/zemarmot
Tipeee: https://www.tipeee.com/zemarmot
Eli Schwartz
2021-05-03 11:47:17 UTC
Permalink
Post by David Faure
The order for mime-types with no defaults has nothing to do with a
"shared database", it's implementation specific, as it's not codified
in the mime specs. GLib probably behaves differently than Qt does,
which means that the file managers using either of those are likely to
behave differently.
Qt's native support for opening files in accordance with XDG is to
invoke /usr/bin/xdg-open.
The actual code for choosing preferred applications for a mimetype, in the Qt/
KDE world, isn't in Qt, but in KDE Frameworks (KService).
That seems highly unlikely. The Qt world can't possibly depend on the
KDE world, because KDE builds on Qt rather than Qt building on KDE. So
applications using Qt for cross-platform application programming, which
aren't KDE applications, will not suddenly go link in KService.

In fact, like I said immediately above, Qt's native facility here is
QDesktopServices::openUrl() which invokes xdg-open. xdg-open then checks
various things to probe for your currently running DE, and...

If that DE is some version of kde it will run kde-open or kfmclient.

If that DE is gnome, then "the Qt world" will be running a program that
then runs "gio open", and hence the actual code for choosing preferred
applications in the Qt world isn't in Qt, but in GLib.

I chose my words very carefully in response to "GLib probably behaves
differently than Qt does" by pointing out that Qt in fact does nothing,
but I assumed people know that xdg-open defers to GLib if you're logged
into gnome, and defers to KDE frameworks if you're logged into KDE.
Post by David Faure
I'm late to this thread, but before we talk about adding even more complexity
to the solution of choosing an app for a mimetype, I'd like to understand why
https://specifications.freedesktop.org/mime-apps-spec/latest/
doesn't solve the issue. If the distro's mimeapps.lst says
image/jpeg=gwenview.desktop;gimp.desktop;
then JPEG files will be opened in gwenview (if installed) rather than in GIMP,
- a DE to define preferred default handlers in $DE-mimeapps.list
- an OS to define preferred default handlers in mimeapps.list
The former is, well, kind of a solution, you can at least solve the
inode/directory problem by force-associating the DE's native file
browser for this one mimetype. You can also solve it for any flagship
applications shipped by the DE, though that's more iffy because maybe
people don't install the flagship programs.
The latter is only a solution for e.g. Ubuntu, where a carefully curated
selection of flagship applications shipped by the *OS* instead of the
DE, are present. You thereby attain a specific look and feel intended by
the Ubuntu desktop team, and consistently get pointed to their preferred
application.
None of this scales well, at all, especially not for mimetypes that are
even slightly off the beaten path.
Yes, I'm on the packaging team for a Linux distro that declines to be
put in the position of being an arbiter of good taste. Don't look to us
to choose preferred mimeapps.lst applications, we refuse.

Even if we wanted to do it, we would be required to provide a
mimeapps.lst defining preferences for several dozens of applications per
mimetype, and any time a hundred different people add a new program to
the repositories we'd need to update this list, and then at the end of
the day users are going to have GIMP plus an unofficial user package
(the "AUR" / Arch User Repository) and GIMP is still going to be the
first on the list somehow for these last-resort-only mimetypes, and the
complaints will be fewer but never actually go away.
--
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User
David Faure
2021-05-03 12:40:40 UTC
Permalink
Post by Eli Schwartz
Post by David Faure
The order for mime-types with no defaults has nothing to do with a
"shared database", it's implementation specific, as it's not codified
in the mime specs. GLib probably behaves differently than Qt does,
which means that the file managers using either of those are likely to
behave differently.
Qt's native support for opening files in accordance with XDG is to
invoke /usr/bin/xdg-open.
The actual code for choosing preferred applications for a mimetype, in the
Qt/ KDE world, isn't in Qt, but in KDE Frameworks (KService).
That seems highly unlikely.
Wanna bet? It's my code, I know very well where it is :)

(But we in fact agree, see below. I should have prefixed my sentence with a
"Yes,")
Post by Eli Schwartz
The Qt world can't possibly depend on the
KDE world, because KDE builds on Qt rather than Qt building on KDE. So
applications using Qt for cross-platform application programming, which
aren't KDE applications, will not suddenly go link in KService.
Link, no, indeed, but there are other ways to call code than linking:
executing processes, for instance.
Post by Eli Schwartz
In fact, like I said immediately above, Qt's native facility here is
QDesktopServices::openUrl() which invokes xdg-open. xdg-open then checks
various things to probe for your currently running DE, and...
If that DE is some version of kde it will run kde-open or kfmclient.
Exactly. And kde-open calls into KService. So for a Qt app in a KDE
environment (Plasma workspace), my assessment is correct, the actual
implementation that ends up being triggered is the one in KService.
Post by Eli Schwartz
If that DE is gnome, then "the Qt world" will be running a program that
then runs "gio open", and hence the actual code for choosing preferred
applications in the Qt world isn't in Qt, but in GLib.
Right.
Post by Eli Schwartz
I chose my words very carefully in response to "GLib probably behaves
differently than Qt does" by pointing out that Qt in fact does nothing,
but I assumed people know that xdg-open defers to GLib if you're logged
into gnome, and defers to KDE frameworks if you're logged into KDE.
OK. Then we're both right. I also chose my words very carefully by saying
"in the Qt/KDE world", i.e. when KDE is there into the equation.
Post by Eli Schwartz
Yes, I'm on the packaging team for a Linux distro that declines to be
put in the position of being an arbiter of good taste. Don't look to us
to choose preferred mimeapps.lst applications, we refuse.
I understand. But then, if
* the distro doesn't want to choose
* the user hasn't made any specific choice
* the application developers are not the best candidate for choosing
then who remains? :)

Actually in KDE we've had a historical solution which allowed application
developers to set an "InitialPreference" number in the desktop file,
but this still requires a desktop-environment-wide agreement.
For instance it allowed us to say that for images, viewers should have
a higher default preference than image editors.
But looking at krita today I see a very high InitialPreference so I guess this
didn't fully work out either...
Let's just say it worked as a a 4th level like:
* the desktop environment as a whole decides on ordering
But of course with apps coming from multiple DEs this can only lead to a fight
between gimp and krita as to who should have the highest preference.

In the end I think
1) desktop environments can provide a mimeapps-$desktop.lst for distros to use
2) users will still have to do some adjustments, especially when using distros
who didn't want to decide for them.

The old debate of View vs Edit doesn't really solve this, as someone mentioned
here, different apps have different features, which goes far beyond View or
Edit.
--
David Faure, ***@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
Jehan Pagès
2021-05-03 13:36:05 UTC
Permalink
Hi!
Post by David Faure
Post by Eli Schwartz
Post by David Faure
The order for mime-types with no defaults has nothing to do with a
"shared database", it's implementation specific, as it's not codified
in the mime specs. GLib probably behaves differently than Qt does,
which means that the file managers using either of those are likely
to
Post by Eli Schwartz
Post by David Faure
behave differently.
Qt's native support for opening files in accordance with XDG is to
invoke /usr/bin/xdg-open.
The actual code for choosing preferred applications for a mimetype, in
the
Post by Eli Schwartz
Post by David Faure
Qt/ KDE world, isn't in Qt, but in KDE Frameworks (KService).
That seems highly unlikely.
Wanna bet? It's my code, I know very well where it is :)
(But we in fact agree, see below. I should have prefixed my sentence with a
"Yes,")
Post by Eli Schwartz
The Qt world can't possibly depend on the
KDE world, because KDE builds on Qt rather than Qt building on KDE. So
applications using Qt for cross-platform application programming, which
aren't KDE applications, will not suddenly go link in KService.
executing processes, for instance.
Post by Eli Schwartz
In fact, like I said immediately above, Qt's native facility here is
QDesktopServices::openUrl() which invokes xdg-open. xdg-open then checks
various things to probe for your currently running DE, and...
If that DE is some version of kde it will run kde-open or kfmclient.
Exactly. And kde-open calls into KService. So for a Qt app in a KDE
environment (Plasma workspace), my assessment is correct, the actual
implementation that ends up being triggered is the one in KService.
Post by Eli Schwartz
If that DE is gnome, then "the Qt world" will be running a program that
then runs "gio open", and hence the actual code for choosing preferred
applications in the Qt world isn't in Qt, but in GLib.
Right.
Post by Eli Schwartz
I chose my words very carefully in response to "GLib probably behaves
differently than Qt does" by pointing out that Qt in fact does nothing,
but I assumed people know that xdg-open defers to GLib if you're logged
into gnome, and defers to KDE frameworks if you're logged into KDE.
OK. Then we're both right. I also chose my words very carefully by saying
"in the Qt/KDE world", i.e. when KDE is there into the equation.
Post by Eli Schwartz
Yes, I'm on the packaging team for a Linux distro that declines to be
put in the position of being an arbiter of good taste. Don't look to us
to choose preferred mimeapps.lst applications, we refuse.
I understand. But then, if
* the distro doesn't want to choose
* the user hasn't made any specific choice
* the application developers are not the best candidate for choosing
then who remains? :)
Actually in KDE we've had a historical solution which allowed application
developers to set an "InitialPreference" number in the desktop file,
but this still requires a desktop-environment-wide agreement.
For instance it allowed us to say that for images, viewers should have
a higher default preference than image editors.
But looking at krita today I see a very high InitialPreference so I guess this
didn't fully work out either...
* the desktop environment as a whole decides on ordering
But of course with apps coming from multiple DEs this can only lead to a fight
between gimp and krita as to who should have the highest preference.
In the end I think
1) desktop environments can provide a mimeapps-$desktop.lst for distros to use
2) users will still have to do some adjustments, especially when using distros
who didn't want to decide for them.
The old debate of View vs Edit doesn't really solve this, as someone mentioned
here, different apps have different features, which goes far beyond View or
Edit.
Which is why my original proposal is not about View vs Edit (please read
it, as apparently you have not). It is about the intent of the app. If I
take GIMP's intent, it is really about editing XCF files.

Now if we comes into PSD or ORA files, these are not GIMP's native files,
but they have clearly similar intent and since we support it, yes GIMP is a
very sane choice too (but if Photoshop were on Linux for instance, I would
say it should advertize to be about editing PSD, hence take precedence when
installed).

Finally we can open various end-formats (PNG, JPEG, WebM, and a few dozens
more
) so GIMP advertizes it in its desktop file. It's important because it
allows GIMP to be in the proposed secondary software (commonly right-click
menu item "open with") which makes life easier to people; and also because
in worst case when no other software can view some image format, even if
you don't want to edit it, at least you can view it in GIMP as a fallback
(I cited a few cases where we were the only free software able to display
some formats for years AFAIK and even now there are some formats where it
is still the case, it would seem).

This is not a GIMP-only situation. I remember cases in my experience where
LibreOffice would open .txt files (like what?!) and other similar weird
events. Right now, we are in this situation where the default is regularly
just weird and there have been various reports of this for years.

So my proposition is not about View vs Edit, please read it. It is an
intent concept, the intent is not too accurate on purpose, because at some
point, over-precision doesn't make sense. Yes at some point the user will
have to choose. For instance the format `.odt` is a valid native format for
LibreOffice, OpenOffice and Calligra AFAIK, so if you have all 3 installed,
the default could be any of these (until an explicit user decision). No
need to add more accuracy IMO. But this much accuracy (as I proposed in 3
intents: native/intended, similar and supports) at least would be extremely
useful to avoid obvious ridiculous defaults.

Jehan
Post by David Faure
--
Working on KDE Frameworks 5
_______________________________________________
xdg mailing list
https://lists.freedesktop.org/mailman/listinfo/xdg
--
ZeMarmot open animation film
http://film.zemarmot.net
Liberapay: https://liberapay.com/ZeMarmot/
Patreon: https://patreon.com/zemarmot
Tipeee: https://www.tipeee.com/zemarmot
Marc Pervaz Boocha
2021-05-03 18:39:32 UTC
Permalink
Post by Jehan Pagès
Hi!
Post by David Faure
Post by Eli Schwartz
Post by David Faure
The order for mime-types with no defaults has nothing to do with a
"shared database", it's implementation specific, as it's not codified
in the mime specs. GLib probably behaves differently than Qt does,
which means that the file managers using either of those are likely
to
Post by Eli Schwartz
Post by David Faure
behave differently.
Qt's native support for opening files in accordance with XDG is to
invoke /usr/bin/xdg-open.
The actual code for choosing preferred applications for a mimetype, in
the
Post by Eli Schwartz
Post by David Faure
Qt/ KDE world, isn't in Qt, but in KDE Frameworks (KService).
That seems highly unlikely.
Wanna bet? It's my code, I know very well where it is :)
(But we in fact agree, see below. I should have prefixed my sentence with a
"Yes,")
Post by Eli Schwartz
The Qt world can't possibly depend on the
KDE world, because KDE builds on Qt rather than Qt building on KDE. So
applications using Qt for cross-platform application programming, which
aren't KDE applications, will not suddenly go link in KService.
executing processes, for instance.
Post by Eli Schwartz
In fact, like I said immediately above, Qt's native facility here is
QDesktopServices::openUrl() which invokes xdg-open. xdg-open then checks
various things to probe for your currently running DE, and...
If that DE is some version of kde it will run kde-open or kfmclient.
Exactly. And kde-open calls into KService. So for a Qt app in a KDE
environment (Plasma workspace), my assessment is correct, the actual
implementation that ends up being triggered is the one in KService.
Post by Eli Schwartz
If that DE is gnome, then "the Qt world" will be running a program that
then runs "gio open", and hence the actual code for choosing preferred
applications in the Qt world isn't in Qt, but in GLib.
Right.
Post by Eli Schwartz
I chose my words very carefully in response to "GLib probably behaves
differently than Qt does" by pointing out that Qt in fact does nothing,
but I assumed people know that xdg-open defers to GLib if you're logged
into gnome, and defers to KDE frameworks if you're logged into KDE.
OK. Then we're both right. I also chose my words very carefully by saying
"in the Qt/KDE world", i.e. when KDE is there into the equation.
Post by Eli Schwartz
Yes, I'm on the packaging team for a Linux distro that declines to be
put in the position of being an arbiter of good taste. Don't look to us
to choose preferred mimeapps.lst applications, we refuse.
I understand. But then, if
* the distro doesn't want to choose
* the user hasn't made any specific choice
* the application developers are not the best candidate for choosing
then who remains? :)
Actually in KDE we've had a historical solution which allowed application
developers to set an "InitialPreference" number in the desktop file,
but this still requires a desktop-environment-wide agreement.
For instance it allowed us to say that for images, viewers should have
a higher default preference than image editors.
But looking at krita today I see a very high InitialPreference so I guess this
didn't fully work out either...
* the desktop environment as a whole decides on ordering
But of course with apps coming from multiple DEs this can only lead to a fight
between gimp and krita as to who should have the highest preference.
In the end I think
1) desktop environments can provide a mimeapps-$desktop.lst for distros to use
2) users will still have to do some adjustments, especially when using distros
who didn't want to decide for them.
The old debate of View vs Edit doesn't really solve this, as someone mentioned
here, different apps have different features, which goes far beyond View or
Edit.
Which is why my original proposal is not about View vs Edit (please read
it, as apparently you have not). It is about the intent of the app. If I
take GIMP's intent, it is really about editing XCF files.
Now if we comes into PSD or ORA files, these are not GIMP's native files,
but they have clearly similar intent and since we support it, yes GIMP is a
very sane choice too (but if Photoshop were on Linux for instance, I would
say it should advertize to be about editing PSD, hence take precedence when
installed).
Finally we can open various end-formats (PNG, JPEG, WebM, and a few dozens
more
) so GIMP advertizes it in its desktop file. It's important because it
allows GIMP to be in the proposed secondary software (commonly right-click
menu item "open with") which makes life easier to people; and also because
in worst case when no other software can view some image format, even if
you don't want to edit it, at least you can view it in GIMP as a fallback
(I cited a few cases where we were the only free software able to display
some formats for years AFAIK and even now there are some formats where it
is still the case, it would seem).
This is not a GIMP-only situation. I remember cases in my experience where
LibreOffice would open .txt files (like what?!) and other similar weird
events. Right now, we are in this situation where the default is regularly
just weird and there have been various reports of this for years.
So my proposition is not about View vs Edit, please read it. It is an
intent concept, the intent is not too accurate on purpose, because at some
point, over-precision doesn't make sense. Yes at some point the user will
have to choose. For instance the format `.odt` is a valid native format for
LibreOffice, OpenOffice and Calligra AFAIK, so if you have all 3 installed,
the default could be any of these (until an explicit user decision). No
need to add more accuracy IMO. But this much accuracy (as I proposed in 3
intents: native/intended, similar and supports) at least would be extremely
useful to avoid obvious ridiculous defaults.
Jehan
Post by David Faure
--
Working on KDE Frameworks 5
_______________________________________________
xdg mailing list
https://lists.freedesktop.org/mailman/listinfo/xdg
--
ZeMarmot open animation film
http://film.zemarmot.net
Liberapay: https://liberapay.com/ZeMarmot/
Patreon: https://patreon.com/zemarmot
Tipeee: https://www.tipeee.com/zemarmot
I think the best option will be a FallbackMIMETYPE which just makes the app lower priority that other option. So gimp, Krita (just had a SVG open in it), some ide can just set it and use It. Another important thing will be to extend the mimetype definitions so mimetypes can inherit mimetype of another mimetype so it reduce the need to set so many mimetype(Especially important for text editor where almost any editor that can handle text/plain can handle other mimetypes in text/ making automatic fallback will help too)
David Faure
2021-05-08 09:18:25 UTC
Permalink
Post by Jehan Pagès
Now if we comes into PSD or ORA files, these are not GIMP's native files,
but they have clearly similar intent and since we support it, yes GIMP is a
very sane choice too (but if Photoshop were on Linux for instance, I would
say it should advertize to be about editing PSD, hence take precedence when
installed).
I see. Basically you're defining three levels of initial preference,
level 2 for native mimetypes, level 1 for "it makes sense to use this app for
these mimetypes too, by default", level 0 for "supported, but should have low
priority".

But as soon as two applications are installed, which both claim level 2,
or both claim level 1 (with no level 2 available), this proposal would just
move the problem, because we again don't know which one to prefer.

So, why not go for an actual number, like the InitialPreference key that KDE
has had forever? It is the same idea, but more expressive because apps can be
ordered along a larger scale. We can still document that "if it's not your
native mimetype, then the number should be below 20", and "if not a mimetype
where it makes sense for your app to be default [I'm trying to explain your
IntentMimeType key here, but probably not doing a good job at it], then it
should be below 10".

The number should be per-mimetype though, unlike KDE's old InitialPreference
key which is global to the desktop file (oops, that was a bad idea).
Post by Jehan Pagès
Finally we can open various end-formats (PNG, JPEG, WebM, and a few dozens
more…) so GIMP advertizes it in its desktop file. It's important because it
allows GIMP to be in the proposed secondary software (commonly right-click
menu item "open with") which makes life easier to people; and also because
in worst case when no other software can view some image format, even if
you don't want to edit it, at least you can view it in GIMP as a fallback
Yes.
Post by Jehan Pagès
This is not a GIMP-only situation. I remember cases in my experience where
LibreOffice would open .txt files (like what?!) and other similar weird
events. Right now, we are in this situation where the default is regularly
just weird and there have been various reports of this for years.
Yes.

This is why org.kde.kwrite.desktop has InitialPreference=8
and writer.desktop has InitialPreference=5.
Post by Jehan Pagès
So my proposition is not about View vs Edit, please read it.
Yes, sorry, I was only referring to old suggestions prompted by the reduced
reasoning of "I don't want to use gimp to view a PNG file, let's distinguish
view and edit". Let's move on.
Post by Jehan Pagès
It is an intent concept
Can we please use any other word? It gets really confusing with the intent
mechanism mentioned by the desktop entry spec (and now the intent-apps spec).

It also makes little sense to me. We don't know the user intent, so I think
you meant "the app intends to be used for mimetype X", but that's true for all
mimetypes it supports, if no other apps is available for it....
It's all a matter of ordering / priority, IMHO, not intent.
Post by Jehan Pagès
the intent is not too accurate on purpose, because at some
point, over-precision doesn't make sense. Yes at some point the user will
have to choose. For instance the format `.odt` is a valid native format for
LibreOffice, OpenOffice and Calligra AFAIK, so if you have all 3 installed,
the default could be any of these (until an explicit user decision).
This is a good example of why numbers would help compared to only 3 levels.
Even though ODT is the native mimetype for all three, Calligra cannot claim to
be as feature complete (and popular) as LibreOffice/OpenOffice so it would be
reasonable for it to ship with a lower default-preference number.

I completely realize that all this relies on application developers being
reasonable (as you said too), and that a global ordering (for a given
mimetype) among different communities is quite hard to achieve. So it won't be
perfect either, but as you say, it would be an improvement already, because at
least it will provide a way to solve the issue, in the case where people
agree.

In summary, I suggest that we combine those two ideas, by documenting ranges
to be used for native mimetypes, for "well supported, makes sense as default"
mimetypes (your PSD example), and for "also supported, but with low preference
by default" mimetypes.

What I don't know, is how to actually write it out in the application desktop
files.

Maybe with an [InitialPreference] group where we can write
image/x-xcf=20
image/x-compressed-xcf=20
image/x-psd=10
image/openraster=10

[and all other mimetypes listed in the MimeType field, would default to 5 or
something like that]

In KDE we made InitialPreference default to 1, and I remember regretting that
choice, it made it impossible to say "should be less than this other app whose
desktop file we don't control and which doesn't use this feature".

What do you think?
--
David Faure, ***@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
Jehan Pagès
2021-05-08 12:53:39 UTC
Permalink
Hi!
Post by David Faure
Post by Jehan Pagès
Now if we comes into PSD or ORA files, these are not GIMP's native files,
but they have clearly similar intent and since we support it, yes GIMP
is a
Post by Jehan Pagès
very sane choice too (but if Photoshop were on Linux for instance, I
would
Post by Jehan Pagès
say it should advertize to be about editing PSD, hence take precedence
when
Post by Jehan Pagès
installed).
I see. Basically you're defining three levels of initial preference,
level 2 for native mimetypes, level 1 for "it makes sense to use this app for
these mimetypes too, by default", level 0 for "supported, but should have low
priority".
But as soon as two applications are installed, which both claim level 2,
or both claim level 1 (with no level 2 available), this proposal would just
move the problem, because we again don't know which one to prefer.
Of course. But why is it a problem? Computers don't read in people's minds
(and I sure hope they never will! 😆). So yes, if you installed 2 software
which support .odt as native format (a good example because there are
actually several software with ODT as native format), I sure don't want my
computer to assume a *better* for me. This is the limit of what my computer
is able to do for me.
Post by David Faure
So, why not go for an actual number, like the InitialPreference key that KDE
has had forever? It is the same idea, but more expressive because apps can be
ordered along a larger scale. We can still document that "if it's not your
native mimetype, then the number should be below 20", and "if not a mimetype
where it makes sense for your app to be default [I'm trying to explain your
IntentMimeType key here, but probably not doing a good job at it], then it
should be below 10".
The thread has been going for so long, maybe I misremember, but I think
someone else proposed this. But no this is wrong for several reasons:

- First giving an exact level of support is often hard if not impossible to
give. Like our level of support to PNG is probably pretty high. But some
weird formats, we often discover new stuff (especially when no spec exist,
or incomplete specs, etc. Like PSD has a spec, by Adobe, visible on the web
but it's actually very incomplete so it's hard to know exactly how good an
application is for this format).
- Also 2 applications may have different parts of a format supported (or
rather different non-supported features). So they can somehow have a
similar level of support yet with various featureset. Therefore a "number"
representing support level is completely meaningless to compare these
applications anyway. In the end, it can only depend on everyone's exact
need (which the OS/desktop/computer cannot guess for them).
- If a dev if really confident and puts every support high, whereas a
prudent one would put low number, we would just end up having the software
from the confident dev open everything.

Edit: I realized while continuing to answer that this number is not about
level of support, but more about "priority". This is bad too, maybe even
worse. I'll explain this in further answers anyway that devs cannot give
priority for their own application!

Basically such numbers make no sense because we cannot exactly map a
support level to such degree of accuracy. It will just be random numbers in
the end.

Also such number system really implies quantifying the format support, this
is not what my initial proposal is about. It is about the "intent". For
instance, PSD is definitely the kind of format which is intended to be
edited in a software as GIMP. E.g. maybe some image viewer software are
able to display PSD, but the chances that someone with a PSD file wants to
open it in a viewer rather than an image editor is low. So if you have
Photoshop itself, it's ideal (native format). If you don't, GIMP or alike
may be your best bet. But this is the "intent". We are not talking about
level of support (which is a very complicated topic we should not go into).
And these should not be mixed, which IMO your point system would end up
looking like.
Post by David Faure
The number should be per-mimetype though, unlike KDE's old
InitialPreference
key which is global to the desktop file (oops, that was a bad idea).
Yes but it actually shows that such point system can have some sense on a
desktop-level. Because yes KDE for instance can create its own preference
system for defaults (until the user made its own preferences). For
instance, first prioritize the most robust KDE applications, then some
experimental ones, then Qt apps, then the rest
 (I guess) Here it makes
sense.

Basically for a desktop, yes numbers can represent preferences, not
necessary level of support. But for the proposal I had, numbers
representing preferences don't make sense. I mean, as software developers,
then I would just put our software as main preferences because that's
obviously how we use it ourselves. So using your description above ("if
it's not your native mimetype, then the number should be below 20", and "if
not a mimetype where it makes sense for your app to be default [
], then it
should be below 10"), I would put native formats as 20, all "same intent"
formats (PSD, ORA
) as 19, then all other formats as 9. That's my actual
preference and in the end, we are back to a 3-level system. That's why a
number system makes sense for desktop preference, not for software exposing
its format usage.
Post by David Faure
Post by Jehan Pagès
Finally we can open various end-formats (PNG, JPEG, WebM, and a few
dozens
Post by Jehan Pagès
more
) so GIMP advertizes it in its desktop file. It's important because
it
Post by Jehan Pagès
allows GIMP to be in the proposed secondary software (commonly
right-click
Post by Jehan Pagès
menu item "open with") which makes life easier to people; and also
because
Post by Jehan Pagès
in worst case when no other software can view some image format, even if
you don't want to edit it, at least you can view it in GIMP as a fallback
Yes.
Post by Jehan Pagès
This is not a GIMP-only situation. I remember cases in my experience
where
Post by Jehan Pagès
LibreOffice would open .txt files (like what?!) and other similar weird
events. Right now, we are in this situation where the default is
regularly
Post by Jehan Pagès
just weird and there have been various reports of this for years.
Yes.
This is why org.kde.kwrite.desktop has InitialPreference=8
and writer.desktop has InitialPreference=5.
Post by Jehan Pagès
So my proposition is not about View vs Edit, please read it.
Yes, sorry, I was only referring to old suggestions prompted by the reduced
reasoning of "I don't want to use gimp to view a PNG file, let's distinguish
view and edit". Let's move on.
No prob! 🙂
Post by David Faure
Post by Jehan Pagès
It is an intent concept
Can we please use any other word? It gets really confusing with the intent
mechanism mentioned by the desktop entry spec (and now the intent-apps spec).
I don't mind using another word, but I really think this is a good word
here (but maybe other wording is acceptable too). It's not a preference
concept, that is for sure, because it makes no sense to ask software
developers to input "preferences" as I demonstrated above. I mean, any
software dev will prefer one's app once it is mature enough (or I sure hope
so! Otherwise it's sad).

It's not a support level concept either (as demonstrated above, once again,
it's just to hard to make it useful and fair).

It's really about saying what your software is intended to open: ours is
intended to open image work-in-progress formats (our native one being XCF,
but we have some support for other similar-intent formats, like the one
from Photoshop, PSD, or ORA) and of course we can also open finale image
formats (PNG, JPEG, etc.) though such formats are not specifically intended
for editing.
Post by David Faure
It also makes little sense to me. We don't know the user intent, so I think
you meant "the app intends to be used for mimetype X", but that's true for all
mimetypes it supports, if no other apps is available for it....
Not sure I understand but maybe. Of course GIMP can start by opening a JPEG
for instance. But JPEG is a lossy format, limited to 8 bpc (well there is
some 12bpc version theoretically but nobody really uses this), with ugly
artifacts and all that. Don't get me wrong: most people edit JPEG but
that's definitely not what this format is for. Pro photographers would
prefer to open the RAW image for instance into darktable, develop it into
an appropriate intermediate format such as TIFF, which GIMP will open. Then
JPEG will only be the finale export format.

In any case, even if you regularly edit JPEG, I am guessing that most
people, when they double-click a JPEG file in their file browser, they want
an image viewer to open, not an image editor (they still want their image
editor to be accessible on right click menu).
Oppositely if you double-click an XCF, you probably want an image editor to
open, not a viewer (even though some viewers may have XCF preview support).

This is why it is really about intent.

(note: of course, some people may want to only see XCF through a viewer,
and maybe others may always want to open JPEG in GIMP, nothing is
impossible; then they have user settings, which already exists; I'm talking
about common case of course)
Post by David Faure
It's all a matter of ordering / priority, IMHO, not intent.
Absolutely not IMO (as explained above). Ordering and priority is left to
the desktop or to the user. How can software developers decide of
ordering/priority of their own applications? All we can do is tell what our
software is for. Not tell what to prefer it to! 🀪

Also AFAICT, there is already specs for ordering/priority at desktop-level,
and users already have the possibility (in all desktops?) to override these
and set their own priority. This already exists. The only thing which
doesn't exist is for software developers to give a bit more insight on what
their software does (not in term of "preferences" but in term of "intent",
because once again, in all good faith, I prefer and use my software. That's
only natural! Makes no sense for me to give preferences or priority
instructions).
Post by David Faure
Post by Jehan Pagès
the intent is not too accurate on purpose, because at some
point, over-precision doesn't make sense. Yes at some point the user will
have to choose. For instance the format `.odt` is a valid native format
for
Post by Jehan Pagès
LibreOffice, OpenOffice and Calligra AFAIK, so if you have all 3
installed,
Post by Jehan Pagès
the default could be any of these (until an explicit user decision).
This is a good example of why numbers would help compared to only 3 levels.
Even though ODT is the native mimetype for all three, Calligra cannot claim to
be as feature complete (and popular) as LibreOffice/OpenOffice so it would be
reasonable for it to ship with a lower default-preference number.
Wait what? Why should popularity even be taken into account? It's like
saying that the big deserve to stay the big ones and we should never even
give the chance to newcomers. I'm saying this as a GIMP developer. What you
propose would be in our software favor, but this is absolutely not why I
proposed this. We don't want special treatment, but the best system which
makes the best experience for people. Some people prefer less known
software and it's perfectly fine (to everyone's their preference!). I don't
want GIMP to be considered a better default just because it's more popular.
And I don't want LibreOffice to be considered obviously better just because
it's popular.

As for the "feature complete" part, I talked about this earlier, this is a
very slippery slope. Not being feature complete is not a good enough point.
Many people prefer the less known software (Calligra, AbiWord
). I meet
some of these people regularly. They don't care about feature completeness
if the supported features are what they need. Also 2 software can have not
a subset of features of one to the other but complementary ones. Feature
completeness is really not enough to qualify the software support.
Feature-completeness is a mirage, always has been, always will be.
Post by David Faure
I completely realize that all this relies on application developers being
reasonable (as you said too),
No if you include concepts of "priority" or "preferences", this is not
about being reasonable anymore. I would be perfectly reasonable to set high
priority to GIMP because that's what I use daily, I work with it, that's
what I actually want to open or show higher in right-click menus. This
would be reasonable. I mean, you asked me my preferences! 🙄 Seriously,
that's my true personal preferences!

Also go to Calligra developers and tell them that they are less popular
than LibreOffice, so it's perfectly reasonable for them to put themselves
in low priority. Let's see what they say.

By the way, did you know that OpenOffice is still more popular than
LibreOffice (maybe not in Linux, but all-platform alike, in sheer number;
at least that's what I was told). So go tell LibreOffice too that they
would be reasonable to put themselves down a bit.

Really nothing is reasonable here. Don't ask developers to prioritize
themselves and relatively to other. Just ask them to tell "what's my
software main intent files?" **This** is reasonable.

Then for more defaulting, let desktop put their own little priority list
(as they already do), and finally let the user make the final choice (as
already possible) if one installed several software of similar intents.
**This too** is reasonable.

and that a global ordering (for a given
Post by David Faure
mimetype) among different communities is quite hard to achieve. So it won't be
perfect either, but as you say, it would be an improvement already, because at
least it will provide a way to solve the issue, in the case where people
agree.
In summary, I suggest that we combine those two ideas, by documenting ranges
to be used for native mimetypes, for "well supported, makes sense as default"
mimetypes (your PSD example), and for "also supported, but with low preference
by default" mimetypes.
What I don't know, is how to actually write it out in the application desktop
files.
Maybe with an [InitialPreference] group where we can write
image/x-xcf=20
image/x-compressed-xcf=20
image/x-psd=10
image/openraster=10
[and all other mimetypes listed in the MimeType field, would default to 5 or
something like that]
No really the more I look at this numbering idea, the worse it looks to me.
I would have seriously no idea how to number most formats. We would end up
not using it. That's not good. 🀷
Post by David Faure
In KDE we made InitialPreference default to 1, and I remember regretting that
choice, it made it impossible to say "should be less than this other app whose
desktop file we don't control and which doesn't use this feature".
What do you think?
See above. 🙂

Jehan
Post by David Faure
--
Working on KDE Frameworks 5
--
ZeMarmot open animation film
http://film.zemarmot.net
Liberapay: https://liberapay.com/ZeMarmot/
Patreon: https://patreon.com/zemarmot
Tipeee: https://www.tipeee.com/zemarmot
David Faure
2021-05-08 18:00:44 UTC
Permalink
Post by Jehan Pagès
Post by David Faure
But as soon as two applications are installed, which both claim level 2,
or both claim level 1 (with no level 2 available), this proposal would just
move the problem, because we again don't know which one to prefer.
Of course. But why is it a problem? Computers don't read in people's minds
(and I sure hope they never will! 😆). So yes, if you installed 2 software
which support .odt as native format (a good example because there are
actually several software with ODT as native format), I sure don't want my
computer to assume a *better* for me. This is the limit of what my computer
is able to do for me.
It's not "the computer" which would assume, it's people with an actual
biological brain would would have done that for you, to avoid bad surprises.
That's exactly the topic of this conversation: humans making choices rather
than "the computer" randomly selecting one of the installed apps.
Post by Jehan Pagès
Basically such numbers make no sense because we cannot exactly map a
support level to such degree of accuracy. It will just be random numbers in
the end.
Numbers which are used to define a priority order. What matters is the order,
not the absolute numbers per se.
Post by Jehan Pagès
Also such number system really implies quantifying the format support, this
is not what my initial proposal is about. It is about the "intent". For
instance, PSD is definitely the kind of format which is intended to be
edited in a software as GIMP. E.g. maybe some image viewer software are
able to display PSD, but the chances that someone with a PSD file wants to
open it in a viewer rather than an image editor is low. So if you have
Photoshop itself, it's ideal (native format). If you don't, GIMP or alike
may be your best bet. But this is the "intent". We are not talking about
level of support (which is a very complicated topic we should not go into).
And these should not be mixed, which IMO your point system would end up
looking like.
You're adding meaning where there isn't. I never talked about quantifying
format support. We are both talking about defining a preference order that is
most likely to make sense for the user. Your assumption however is that 3
levels are enough for this.
Post by Jehan Pagès
Basically for a desktop, yes numbers can represent preferences, not
necessary level of support. But for the proposal I had, numbers
representing preferences don't make sense. I mean, as software developers,
then I would just put our software as main preferences because that's
obviously how we use it ourselves. So using your description above ("if
it's not your native mimetype, then the number should be below 20", and "if
not a mimetype where it makes sense for your app to be default […], then it
should be below 10"), I would put native formats as 20, all "same intent"
formats (PSD, ORA…) as 19, then all other formats as 9. That's my actual
preference and in the end, we are back to a 3-level system. That's why a
number system makes sense for desktop preference, not for software exposing
its format usage.
I was merely showing how you could use the number system to model the fact
that you determined that for GIMP, 3 levels are enough. But I'm trying to come
up with something that is flexible enough for all cases, not just for GIMP's
use case.

Imagine GIMP had very basic support for another editing format like PSD,
but there was another Linux application with much more complete support for
that format... then 19 would be incorrect and a lower number would be more
appropriate.

Imagine I start writing today an XCF editor written in Qt, a gimp competitor.
XCF would be the native mimetype for that application. But surely it shouldn't
have the same priority as gimp, on a system with no user preference set.
As the developer of, ahem, Qimp :), I would use a much lower preference number
than gimp, to make sure I don't get tons of bug reports from gimp users who
suddenly end up opening xcf files in my very limited application.
In 10 years when qimp is complete, then the apps can compete on equal footing
in the preference system, but not until then.
Post by Jehan Pagès
Post by David Faure
Can we please use any other word? It gets really confusing with the intent
mechanism mentioned by the desktop entry spec (and now the intent-apps spec).
I don't mind using another word, but I really think this is a good word
here (but maybe other wording is acceptable too). It's not a preference
concept, that is for sure, because it makes no sense to ask software
developers to input "preferences" as I demonstrated above. I mean, any
software dev will prefer one's app once it is mature enough (or I sure hope
so! Otherwise it's sad).
See above: reasonable devs wouldn't use a high number if the app is
experimental / suboptimal / still in initial development. And if they do, I am
counting on distros / users to push against that (or even patch it at the
distro level). The same would happen with your proposal if people used
"Intent" or "Native" incorrectly.
Post by Jehan Pagès
It's really about saying what your software is intended to open: ours is
intended to open image work-in-progress formats (our native one being XCF,
but we have some support for other similar-intent formats, like the one
from Photoshop, PSD, or ORA) and of course we can also open finale image
formats (PNG, JPEG, etc.) though such formats are not specifically intended
for editing.
Yes, those are the 3 categories of mimetypes supported by GIMP, I get that.
In GIMP the distinction is clear, I can see why you think it's all that is
needed :)

But in my 20 years of handling this topic in KDE, I have seen many other
subtleties that require tweaking among these 3 categories.

One more example: gvim developers are surely very proud of gvim, but do they
really expect it to be the default text editor on a brand new Linux system? I
surely hope not. My family members using Linux would be extremely confused if
editing text files opened up gvim. And yet, text/plain is a native mimetype
for all text editors, so it would (still) be on equal footing with more
intuitive text editors like gedit or kwrite/kate, with the risk of being
selected as default. Surely gvim should have a lower preference than those by
default.
Post by Jehan Pagès
[...]
In any case, even if you regularly edit JPEG, I am guessing that most
people, when they double-click a JPEG file in their file browser, they want
an image viewer to open, not an image editor (they still want their image
editor to be accessible on right click menu).
Oppositely if you double-click an XCF, you probably want an image editor to
open, not a viewer (even though some viewers may have XCF preview support).
This is why it is really about intent.
That's more about the intended usage of a file format, than about the intended
application to use for it. A text/plain file is intended to be edited by a
text editor. Great. That doesn't tell me which one.
Post by Jehan Pagès
Post by David Faure
It's all a matter of ordering / priority, IMHO, not intent.
Absolutely not IMO (as explained above). Ordering and priority is left to
the desktop or to the user. How can software developers decide of
ordering/priority of their own applications? All we can do is tell what our
software is for. Not tell what to prefer it to! 🤪
I get that everybody says "I shouldn't have to define ordering/priority",
in this thread I heard people say that it's not the distro's job, now you say
it's not the software developer's job, so what's left? Anything is better than
random... (and yes, alphabetical order is similar to random since it's based
on a fact that is completely unrelated to what's best for the user).
Post by Jehan Pagès
Wait what? Why should popularity even be taken into account? It's like
saying that the big deserve to stay the big ones and we should never even
give the chance to newcomers. I'm saying this as a GIMP developer. What you
propose would be in our software favor, but this is absolutely not why I
proposed this. We don't want special treatment, but the best system which
makes the best experience for people. Some people prefer less known
software and it's perfectly fine (to everyone's their preference!).
Those people can make their choice. As you said yourself we're only discussing
defaults which work for the majority, it's still all configurable by user who
have other preferences (and distros who target specific user groups,
possibly).
Post by Jehan Pagès
I don't
want GIMP to be considered a better default just because it's more popular.
And I don't want LibreOffice to be considered obviously better just because
it's popular.
They are popular because they do the job for most people. Why shouldn't they
be used by default, compared to other apps which less people prefer, surely
for a good reason? (whatever the reason is: features, look, performance, ...).
Post by Jehan Pagès
As for the "feature complete" part, I talked about this earlier, this is a
very slippery slope. Not being feature complete is not a good enough point.
Many people prefer the less known software (Calligra, AbiWord…). I meet
some of these people regularly. They don't care about feature completeness
Good. I'm one of them, when it comes to presentation software, actually.
But again, we (those people) can very easily make our choice known to the
system. Meanwhile doesn't it make sense that the default matches the
preference of the majority of users?

What's your actual proposal for choosing among all apps that natively support
the mimetype, other than saying "not my problem"?
If you don't define it, then it'll be the current solution which is either
"random" or "first one alphabetically". Does it really make sense for abiword
to be the default word processor on all linux distributions, just because it
starts with an 'a'?
Post by Jehan Pagès
No if you include concepts of "priority" or "preferences", this is not
about being reasonable anymore. I would be perfectly reasonable to set high
priority to GIMP because that's what I use daily, I work with it, that's
what I actually want to open or show higher in right-click menus. This
would be reasonable. I mean, you asked me my preferences! 🙄 Seriously,
that's my true personal preferences!
Surely you are able to distinguish your preferences as a user from what the
default preference should be for the majority of users.
Post by Jehan Pagès
Also go to Calligra developers and tell them that they are less popular
than LibreOffice, so it's perfectly reasonable for them to put themselves
in low priority. Let's see what they say.
I am a Calligra developer. Well, used to be, but I know very well the other
developers, and I have zero doubts that they would agree that Calligra in its
current state should not be the default for new users who have LibreOffice
installed. It would be extremely foolish to pretend otherwise, and they know
that.
Post by Jehan Pagès
By the way, did you know that OpenOffice is still more popular than
LibreOffice (maybe not in Linux, but all-platform alike, in sheer number;
at least that's what I was told). So go tell LibreOffice too that they
would be reasonable to put themselves down a bit.
Obviously all this is only about "free desktops", not about platforms who
don't even care about desktop files. Please stop jumping at me for using the
word "popular" as *one* of the criteria, as if I used it as the *only*
criteria.

And the majority of Linux distributions ships LibreOffice, not OpenOffice,
right? So this would be moot anyway, the numbers only make a difference if
both are installed.
Post by Jehan Pagès
Really nothing is reasonable here. Don't ask developers to prioritize
themselves and relatively to other. Just ask them to tell "what's my
software main intent files?" **This** is reasonable.
It might be, but it doesn't solve the problem.

What's the point in adding complexity if it doesn't actually solve the
problem?
Post by Jehan Pagès
Then for more defaulting, let desktop put their own little priority list
(as they already do), and finally let the user make the final choice (as
already possible) if one installed several software of similar intents.
**This too** is reasonable.
I have made my case, you have made yours, I think at this point we need
external input. If other people with experience with this topic (e.g.
developers of desktop environments or distributors dealing with this topic)
agree with you that 3 levels are enough, I will be reasonable and I will drop
pushing for more flexibility.
Post by Jehan Pagès
I would have seriously no idea how to number most formats. We would end up
not using it. That's not good. 🤷
The rules would be something like:

* 15-25 (default 20) for native mimetypes
* 5-15 (default 10) for mimetypes you want your app to be used for by default
* 5 if you don't specify anything
* 1-4 if you purposely want to make sure your app have very little chance of
being used by default for this mimetype (like LibreOffice for text/plain).

So, on day one, you'd only use 20, 10, 5 as per my earlier example.
But as time goes, tweaks would be possible, depending on what other
applications exist for those mimetypes and what makes most sense for the
default ordering.


The alternative is to define this (the ordering of apps for a mimetype)
outside the app desktop file, more globally, that's exactly what I thought
distros would do in their mimeapps.lst global file, but in this thread some of
them are clearly saying "nope, it's not our job". So all I see is people
refusing responsibility on this topic....

The one thing that helps a little bit in all this is that not everything is
installed by default, so the "conflict" between apps only exists between apps
that were pre-installed, or with apps that were manually installed on top for
one purpose and end up taking over unwanted mimetypes (like your GIMP example
I suppose). So there's no need for anyone to decide if abiword is better than
calligra because most users don't install both, I suppose. This is probably
why distros don't see how to write out a full mimeapps.lst. But they could
still ensure GIMP isn't the preferred app for PNGs, by listing all image
viewers before gimp :). You and me are suggesting that the image viewers
themselves are able to say in their desktop file that they should be preferred
over GIMP. We "only" disagree on the granularity of that information, but the
overall idea is similar. Now that we both presented our version of this idea,
I think we need input from other people, as stated above :)

Thanks,
--
David Faure, ***@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
Stefan Blachmann
2021-05-08 19:23:17 UTC
Permalink
Some thoughts.

There are several "usage criteria" that could be used for ordering.
In a situation when one just wants to quickly view something then the
criteria are different ones when one wants to edit. Some people prefer
simplicity. Others prefer feature-completeness. And so on.
I doubt that these different "usage criteria" (maybe an alternative
term for "intents"?) can be combined in one valid-for-all number.

There have been identified some usage criteria parameters:
- view ... edit (some viewers allow simple editing too, so this is
also sort of a scale)
- degree of format support/feature completeness
- user interface (console-ish ... KDE-ish ... Gnome-ish)
- and probably more (TBD: find them)

Compared to a more-or-less arbitrary single [in]valid-for-all number,
such kind of parameters are easily definable and reasonably accurately
measurable.

If the spec allows a number of these most important characterizations,
these can be used in conjunction with the users' settings to determine
an appropriate application suitability list.

In my inner eye I now see a Gnome-ish simple configuration with a few
sliders where the user can set these preferences. So this could be
very easily configurable, too.


What I *definitely* like is the possibility of deprioritizing
particularly uncommonly used mime types/applications combos, like
text/plain+LibreOffice, or text/pdf and GIMP.


If the specification would allow association of apps to their "native"
DE, e.g. apps that belong to a particular DE, and DE-independent apps,
that would be *very* nice, too.

Because, the apps in the OpenWith list could then be sorted depending
on the users' DE preferences.
For example, DE-independent-apps > DE1 apps > DE2 apps > DE3 apps.
This surely would make a much more orderly impression than the current
random chaos.

The possibility to show in the menu the application-associated DE
(e.g. Okular [KDE], Evince [Gnome], ...) might also be nifty.
Post by David Faure
Post by Jehan Pagès
Post by David Faure
But as soon as two applications are installed, which both claim level 2,
or both claim level 1 (with no level 2 available), this proposal would just
move the problem, because we again don't know which one to prefer.
Of course. But why is it a problem? Computers don't read in people's minds
(and I sure hope they never will! 😆). So yes, if you installed 2 software
which support .odt as native format (a good example because there are
actually several software with ODT as native format), I sure don't want my
computer to assume a *better* for me. This is the limit of what my computer
is able to do for me.
It's not "the computer" which would assume, it's people with an actual
biological brain would would have done that for you, to avoid bad surprises.
That's exactly the topic of this conversation: humans making choices rather
than "the computer" randomly selecting one of the installed apps.
Post by Jehan Pagès
Basically such numbers make no sense because we cannot exactly map a
support level to such degree of accuracy. It will just be random numbers in
the end.
Numbers which are used to define a priority order. What matters is the order,
not the absolute numbers per se.
Post by Jehan Pagès
Also such number system really implies quantifying the format support, this
is not what my initial proposal is about. It is about the "intent". For
instance, PSD is definitely the kind of format which is intended to be
edited in a software as GIMP. E.g. maybe some image viewer software are
able to display PSD, but the chances that someone with a PSD file wants to
open it in a viewer rather than an image editor is low. So if you have
Photoshop itself, it's ideal (native format). If you don't, GIMP or alike
may be your best bet. But this is the "intent". We are not talking about
level of support (which is a very complicated topic we should not go into).
And these should not be mixed, which IMO your point system would end up
looking like.
You're adding meaning where there isn't. I never talked about quantifying
format support. We are both talking about defining a preference order that is
most likely to make sense for the user. Your assumption however is that 3
levels are enough for this.
Post by Jehan Pagès
Basically for a desktop, yes numbers can represent preferences, not
necessary level of support. But for the proposal I had, numbers
representing preferences don't make sense. I mean, as software developers,
then I would just put our software as main preferences because that's
obviously how we use it ourselves. So using your description above ("if
it's not your native mimetype, then the number should be below 20", and "if
not a mimetype where it makes sense for your app to be default […], then it
should be below 10"), I would put native formats as 20, all "same intent"
formats (PSD, ORA…) as 19, then all other formats as 9. That's my actual
preference and in the end, we are back to a 3-level system. That's why a
number system makes sense for desktop preference, not for software exposing
its format usage.
I was merely showing how you could use the number system to model the fact
that you determined that for GIMP, 3 levels are enough. But I'm trying to come
up with something that is flexible enough for all cases, not just for GIMP's
use case.
Imagine GIMP had very basic support for another editing format like PSD,
but there was another Linux application with much more complete support for
that format... then 19 would be incorrect and a lower number would be more
appropriate.
Imagine I start writing today an XCF editor written in Qt, a gimp competitor.
XCF would be the native mimetype for that application. But surely it shouldn't
have the same priority as gimp, on a system with no user preference set.
As the developer of, ahem, Qimp :), I would use a much lower preference number
than gimp, to make sure I don't get tons of bug reports from gimp users who
suddenly end up opening xcf files in my very limited application.
In 10 years when qimp is complete, then the apps can compete on equal footing
in the preference system, but not until then.
Post by Jehan Pagès
Post by David Faure
Can we please use any other word? It gets really confusing with the intent
mechanism mentioned by the desktop entry spec (and now the intent-apps spec).
I don't mind using another word, but I really think this is a good word
here (but maybe other wording is acceptable too). It's not a preference
concept, that is for sure, because it makes no sense to ask software
developers to input "preferences" as I demonstrated above. I mean, any
software dev will prefer one's app once it is mature enough (or I sure hope
so! Otherwise it's sad).
See above: reasonable devs wouldn't use a high number if the app is
experimental / suboptimal / still in initial development. And if they do, I am
counting on distros / users to push against that (or even patch it at the
distro level). The same would happen with your proposal if people used
"Intent" or "Native" incorrectly.
Post by Jehan Pagès
It's really about saying what your software is intended to open: ours is
intended to open image work-in-progress formats (our native one being XCF,
but we have some support for other similar-intent formats, like the one
from Photoshop, PSD, or ORA) and of course we can also open finale image
formats (PNG, JPEG, etc.) though such formats are not specifically intended
for editing.
Yes, those are the 3 categories of mimetypes supported by GIMP, I get that.
In GIMP the distinction is clear, I can see why you think it's all that is
needed :)
But in my 20 years of handling this topic in KDE, I have seen many other
subtleties that require tweaking among these 3 categories.
One more example: gvim developers are surely very proud of gvim, but do they
really expect it to be the default text editor on a brand new Linux system? I
surely hope not. My family members using Linux would be extremely confused if
editing text files opened up gvim. And yet, text/plain is a native mimetype
for all text editors, so it would (still) be on equal footing with more
intuitive text editors like gedit or kwrite/kate, with the risk of being
selected as default. Surely gvim should have a lower preference than those by
default.
Post by Jehan Pagès
[...]
In any case, even if you regularly edit JPEG, I am guessing that most
people, when they double-click a JPEG file in their file browser, they want
an image viewer to open, not an image editor (they still want their image
editor to be accessible on right click menu).
Oppositely if you double-click an XCF, you probably want an image editor to
open, not a viewer (even though some viewers may have XCF preview support).
This is why it is really about intent.
That's more about the intended usage of a file format, than about the intended
application to use for it. A text/plain file is intended to be edited by a
text editor. Great. That doesn't tell me which one.
Post by Jehan Pagès
Post by David Faure
It's all a matter of ordering / priority, IMHO, not intent.
Absolutely not IMO (as explained above). Ordering and priority is left to
the desktop or to the user. How can software developers decide of
ordering/priority of their own applications? All we can do is tell what our
software is for. Not tell what to prefer it to! 🤪
I get that everybody says "I shouldn't have to define ordering/priority",
in this thread I heard people say that it's not the distro's job, now you say
it's not the software developer's job, so what's left? Anything is better than
random... (and yes, alphabetical order is similar to random since it's based
on a fact that is completely unrelated to what's best for the user).
Post by Jehan Pagès
Wait what? Why should popularity even be taken into account? It's like
saying that the big deserve to stay the big ones and we should never even
give the chance to newcomers. I'm saying this as a GIMP developer. What you
propose would be in our software favor, but this is absolutely not why I
proposed this. We don't want special treatment, but the best system which
makes the best experience for people. Some people prefer less known
software and it's perfectly fine (to everyone's their preference!).
Those people can make their choice. As you said yourself we're only discussing
defaults which work for the majority, it's still all configurable by user who
have other preferences (and distros who target specific user groups,
possibly).
Post by Jehan Pagès
I don't
want GIMP to be considered a better default just because it's more popular.
And I don't want LibreOffice to be considered obviously better just because
it's popular.
They are popular because they do the job for most people. Why shouldn't they
be used by default, compared to other apps which less people prefer, surely
for a good reason? (whatever the reason is: features, look, performance, ...).
Post by Jehan Pagès
As for the "feature complete" part, I talked about this earlier, this is a
very slippery slope. Not being feature complete is not a good enough point.
Many people prefer the less known software (Calligra, AbiWord…). I meet
some of these people regularly. They don't care about feature completeness
Good. I'm one of them, when it comes to presentation software, actually.
But again, we (those people) can very easily make our choice known to the
system. Meanwhile doesn't it make sense that the default matches the
preference of the majority of users?
What's your actual proposal for choosing among all apps that natively support
the mimetype, other than saying "not my problem"?
If you don't define it, then it'll be the current solution which is either
"random" or "first one alphabetically". Does it really make sense for abiword
to be the default word processor on all linux distributions, just because it
starts with an 'a'?
Post by Jehan Pagès
No if you include concepts of "priority" or "preferences", this is not
about being reasonable anymore. I would be perfectly reasonable to set high
priority to GIMP because that's what I use daily, I work with it, that's
what I actually want to open or show higher in right-click menus. This
would be reasonable. I mean, you asked me my preferences! 🙄 Seriously,
that's my true personal preferences!
Surely you are able to distinguish your preferences as a user from what the
default preference should be for the majority of users.
Post by Jehan Pagès
Also go to Calligra developers and tell them that they are less popular
than LibreOffice, so it's perfectly reasonable for them to put themselves
in low priority. Let's see what they say.
I am a Calligra developer. Well, used to be, but I know very well the other
developers, and I have zero doubts that they would agree that Calligra in its
current state should not be the default for new users who have LibreOffice
installed. It would be extremely foolish to pretend otherwise, and they know
that.
Post by Jehan Pagès
By the way, did you know that OpenOffice is still more popular than
LibreOffice (maybe not in Linux, but all-platform alike, in sheer number;
at least that's what I was told). So go tell LibreOffice too that they
would be reasonable to put themselves down a bit.
Obviously all this is only about "free desktops", not about platforms who
don't even care about desktop files. Please stop jumping at me for using the
word "popular" as *one* of the criteria, as if I used it as the *only*
criteria.
And the majority of Linux distributions ships LibreOffice, not OpenOffice,
right? So this would be moot anyway, the numbers only make a difference if
both are installed.
Post by Jehan Pagès
Really nothing is reasonable here. Don't ask developers to prioritize
themselves and relatively to other. Just ask them to tell "what's my
software main intent files?" **This** is reasonable.
It might be, but it doesn't solve the problem.
What's the point in adding complexity if it doesn't actually solve the
problem?
Post by Jehan Pagès
Then for more defaulting, let desktop put their own little priority list
(as they already do), and finally let the user make the final choice (as
already possible) if one installed several software of similar intents.
**This too** is reasonable.
I have made my case, you have made yours, I think at this point we need
external input. If other people with experience with this topic (e.g.
developers of desktop environments or distributors dealing with this topic)
agree with you that 3 levels are enough, I will be reasonable and I will drop
pushing for more flexibility.
Post by Jehan Pagès
I would have seriously no idea how to number most formats. We would end up
not using it. That's not good. 🤷
* 15-25 (default 20) for native mimetypes
* 5-15 (default 10) for mimetypes you want your app to be used for by default
* 5 if you don't specify anything
* 1-4 if you purposely want to make sure your app have very little chance of
being used by default for this mimetype (like LibreOffice for text/plain).
So, on day one, you'd only use 20, 10, 5 as per my earlier example.
But as time goes, tweaks would be possible, depending on what other
applications exist for those mimetypes and what makes most sense for the
default ordering.
The alternative is to define this (the ordering of apps for a mimetype)
outside the app desktop file, more globally, that's exactly what I thought
distros would do in their mimeapps.lst global file, but in this thread some of
them are clearly saying "nope, it's not our job". So all I see is people
refusing responsibility on this topic....
The one thing that helps a little bit in all this is that not everything is
installed by default, so the "conflict" between apps only exists between apps
that were pre-installed, or with apps that were manually installed on top for
one purpose and end up taking over unwanted mimetypes (like your GIMP example
I suppose). So there's no need for anyone to decide if abiword is better than
calligra because most users don't install both, I suppose. This is probably
why distros don't see how to write out a full mimeapps.lst. But they could
still ensure GIMP isn't the preferred app for PNGs, by listing all image
viewers before gimp :). You and me are suggesting that the image viewers
themselves are able to say in their desktop file that they should be preferred
over GIMP. We "only" disagree on the granularity of that information, but the
overall idea is similar. Now that we both presented our version of this idea,
I think we need input from other people, as stated above :)
Thanks,
--
Working on KDE Frameworks 5
_______________________________________________
xdg mailing list
https://lists.freedesktop.org/mailman/listinfo/xdg
Jehan Pagès
2021-05-08 19:40:12 UTC
Permalink
Hi!

A quick message!
Post by Jehan Pagès
Post by Jehan Pagès
Post by David Faure
But as soon as two applications are installed, which both claim level
2,
Post by Jehan Pagès
Post by David Faure
or both claim level 1 (with no level 2 available), this proposal would just
move the problem, because we again don't know which one to prefer.
Of course. But why is it a problem? Computers don't read in people's
minds
Post by Jehan Pagès
(and I sure hope they never will! 😆). So yes, if you installed 2
software
Post by Jehan Pagès
which support .odt as native format (a good example because there are
actually several software with ODT as native format), I sure don't want
my
Post by Jehan Pagès
computer to assume a *better* for me. This is the limit of what my
computer
Post by Jehan Pagès
is able to do for me.
It's not "the computer" which would assume, it's people with an actual
biological brain would would have done that for you, to avoid bad surprises.
That's exactly the topic of this conversation: humans making choices rather
than "the computer" randomly selecting one of the installed apps.
I guess it's where we diverge. I don't really want the software developers
to make a choice for people. Just helping/hinting with that choice. Now how
that choice is exactly made later on? Querying people all the first times
(as someone proposed in the original thread)? Have desktop devs and
distribution packagers make priority lists (this is already the case,
though it can't be exhaustive by definition)? Using randomness (as long as
it's consistent, so once randomness was applied once, the same software
should be called the next times) but only within an appropriate set of
software (i.e. don't put GIMP in the random list for JPEG, don't put an
image viewer for XCF
)? Something else? I don't know.

I just think that usage hinting can help for all these use cases.
Post by Jehan Pagès
Post by Jehan Pagès
Basically such numbers make no sense because we cannot exactly map a
support level to such degree of accuracy. It will just be random numbers
in
Post by Jehan Pagès
the end.
Numbers which are used to define a priority order. What matters is the order,
not the absolute numbers per se.
Post by Jehan Pagès
Also such number system really implies quantifying the format support,
this
Post by Jehan Pagès
is not what my initial proposal is about. It is about the "intent". For
instance, PSD is definitely the kind of format which is intended to be
edited in a software as GIMP. E.g. maybe some image viewer software are
able to display PSD, but the chances that someone with a PSD file wants
to
Post by Jehan Pagès
open it in a viewer rather than an image editor is low. So if you have
Photoshop itself, it's ideal (native format). If you don't, GIMP or alike
may be your best bet. But this is the "intent". We are not talking about
level of support (which is a very complicated topic we should not go
into).
Post by Jehan Pagès
And these should not be mixed, which IMO your point system would end up
looking like.
You're adding meaning where there isn't. I never talked about quantifying
format support. We are both talking about defining a preference order that is
most likely to make sense for the user. Your assumption however is that 3
levels are enough for this.
Post by Jehan Pagès
Basically for a desktop, yes numbers can represent preferences, not
necessary level of support. But for the proposal I had, numbers
representing preferences don't make sense. I mean, as software
developers,
Post by Jehan Pagès
then I would just put our software as main preferences because that's
obviously how we use it ourselves. So using your description above ("if
it's not your native mimetype, then the number should be below 20", and
"if
Post by Jehan Pagès
not a mimetype where it makes sense for your app to be default [
], then
it
Post by Jehan Pagès
should be below 10"), I would put native formats as 20, all "same intent"
formats (PSD, ORA
) as 19, then all other formats as 9. That's my actual
preference and in the end, we are back to a 3-level system. That's why a
number system makes sense for desktop preference, not for software
exposing
Post by Jehan Pagès
its format usage.
I was merely showing how you could use the number system to model the fact
that you determined that for GIMP, 3 levels are enough. But I'm trying to come
up with something that is flexible enough for all cases, not just for GIMP's
use case.
Imagine GIMP had very basic support for another editing format like PSD,
but there was another Linux application with much more complete support for
that format... then 19 would be incorrect and a lower number would be more
appropriate.
Actually PSD is a good example because none of the Free Software have an
awesome support AFAIK. Some have better support than others on some
specific features of PSD, the other have better support on other feature
set. It's not like we can really keep track of every update every other
software does (it's not a competition anyway). I would have no idea how to
compare to others. And seriously I would feel bad to make a judgement
(based on not much) to decide that we have worse or better support than
another software.
Now multiply having to do this for the ~36 mime types GIMP seems to handle
(after a quick check in our build).

Not even counting that if we write a lower number, then our users will
complain that GIMP does not get opened when opening PSD; if I write a
bigger number, then we might get attacks by fans of other software saying
we are badmouthing through this number and that we are lying
 It's
stressful and we are quite subject to attacks whatever we do, so if we now
add a note-like system, I can't imagine how it could get like. That's why
for me, it's a very very bad idea. If it gets there, I would prefer not to
use such a system. I don't want to note our own support comparatively to
others. I just want to say "yeah we handle this", then people can try and
make their own judgement.
Post by Jehan Pagès
Imagine I start writing today an XCF editor written in Qt, a gimp competitor.
XCF would be the native mimetype for that application. But surely it shouldn't
have the same priority as gimp, on a system with no user preference set.
As the developer of, ahem, Qimp :), I would use a much lower preference number
than gimp, to make sure I don't get tons of bug reports from gimp users who
suddenly end up opening xcf files in my very limited application.
In 10 years when qimp is complete, then the apps can compete on equal footing
in the preference system, but not until then.
Well if Qimp is good and really use the same XCF as GIMP (I'm adding this
precision because I am told there used to be a software which used XCF but
the formats slowly drifted apart, which would have been a bad situation:
not actually the same format, but recognized as the same), I wouldn't mind
it to be considered a serious contender for usage of the format. 🙂
Post by Jehan Pagès
Post by Jehan Pagès
Post by David Faure
Can we please use any other word? It gets really confusing with the
intent
Post by Jehan Pagès
Post by David Faure
mechanism mentioned by the desktop entry spec (and now the intent-apps spec).
I don't mind using another word, but I really think this is a good word
here (but maybe other wording is acceptable too). It's not a preference
concept, that is for sure, because it makes no sense to ask software
developers to input "preferences" as I demonstrated above. I mean, any
software dev will prefer one's app once it is mature enough (or I sure
hope
Post by Jehan Pagès
so! Otherwise it's sad).
See above: reasonable devs wouldn't use a high number if the app is
experimental / suboptimal / still in initial development. And if they do, I am
counting on distros / users to push against that (or even patch it at the
distro level). The same would happen with your proposal if people used
"Intent" or "Native" incorrectly.
Post by Jehan Pagès
It's really about saying what your software is intended to open: ours is
intended to open image work-in-progress formats (our native one being
XCF,
Post by Jehan Pagès
but we have some support for other similar-intent formats, like the one
from Photoshop, PSD, or ORA) and of course we can also open finale image
formats (PNG, JPEG, etc.) though such formats are not specifically
intended
Post by Jehan Pagès
for editing.
Yes, those are the 3 categories of mimetypes supported by GIMP, I get that.
In GIMP the distinction is clear, I can see why you think it's all that is
needed :)
But in my 20 years of handling this topic in KDE, I have seen many other
subtleties that require tweaking among these 3 categories.
One more example: gvim developers are surely very proud of gvim, but do they
really expect it to be the default text editor on a brand new Linux system? I
surely hope not. My family members using Linux would be extremely confused if
editing text files opened up gvim. And yet, text/plain is a native mimetype
for all text editors, so it would (still) be on equal footing with more
intuitive text editors like gedit or kwrite/kate, with the risk of being
selected as default. Surely gvim should have a lower preference than those by
default.
Post by Jehan Pagès
[...]
In any case, even if you regularly edit JPEG, I am guessing that most
people, when they double-click a JPEG file in their file browser, they
want
Post by Jehan Pagès
an image viewer to open, not an image editor (they still want their image
editor to be accessible on right click menu).
Oppositely if you double-click an XCF, you probably want an image editor
to
Post by Jehan Pagès
open, not a viewer (even though some viewers may have XCF preview
support).
Post by Jehan Pagès
This is why it is really about intent.
That's more about the intended usage of a file format, than about the intended
application to use for it. A text/plain file is intended to be edited by a
text editor. Great. That doesn't tell me which one.
Post by Jehan Pagès
Post by David Faure
It's all a matter of ordering / priority, IMHO, not intent.
Absolutely not IMO (as explained above). Ordering and priority is left to
the desktop or to the user. How can software developers decide of
ordering/priority of their own applications? All we can do is tell what
our
Post by Jehan Pagès
software is for. Not tell what to prefer it to! 🀪
I get that everybody says "I shouldn't have to define ordering/priority",
in this thread I heard people say that it's not the distro's job, now you say
it's not the software developer's job, so what's left? Anything is better than
random... (and yes, alphabetical order is similar to random since it's based
on a fact that is completely unrelated to what's best for the user).
Post by Jehan Pagès
Wait what? Why should popularity even be taken into account? It's like
saying that the big deserve to stay the big ones and we should never even
give the chance to newcomers. I'm saying this as a GIMP developer. What
you
Post by Jehan Pagès
propose would be in our software favor, but this is absolutely not why I
proposed this. We don't want special treatment, but the best system which
makes the best experience for people. Some people prefer less known
software and it's perfectly fine (to everyone's their preference!).
Those people can make their choice. As you said yourself we're only discussing
defaults which work for the majority, it's still all configurable by user who
have other preferences (and distros who target specific user groups,
possibly).
Post by Jehan Pagès
I don't
want GIMP to be considered a better default just because it's more
popular.
Post by Jehan Pagès
And I don't want LibreOffice to be considered obviously better just
because
Post by Jehan Pagès
it's popular.
They are popular because they do the job for most people. Why shouldn't they
be used by default, compared to other apps which less people prefer, surely
for a good reason? (whatever the reason is: features, look, performance, ...).
Post by Jehan Pagès
As for the "feature complete" part, I talked about this earlier, this is
a
Post by Jehan Pagès
very slippery slope. Not being feature complete is not a good enough
point.
Post by Jehan Pagès
Many people prefer the less known software (Calligra, AbiWord
). I meet
some of these people regularly. They don't care about feature
completeness
Good. I'm one of them, when it comes to presentation software, actually.
But again, we (those people) can very easily make our choice known to the
system. Meanwhile doesn't it make sense that the default matches the
preference of the majority of users?
What's your actual proposal for choosing among all apps that natively support
the mimetype, other than saying "not my problem"?
It's not about not being my problem. It's about the fact I don't think we
should be choosing. For desktop devs trying to make some kind of consistent
experience (GNOME, KDE, XFCE
), I can understand that they would want to
make lists of top software for various usage, that's only fair. Similarly
on a higher level, distributions add their own touch. But should software
developers be a part of the whole choice, other than saying "here is what
my software is for"?

So really, I don't mind if there are imperfect defaults, even some
randomness to be fair, but it has to make a minimum bit of sense. Like
don't open text files in LibreOffice by default, don't open JPEG files by
default in GIMP, don't open a PDF in GIMP either as a default
 these kinds
of nonsense (yeah all these happened to me at one point or another). But
yeah, if I have both LibreOffice and Calligra installed (as I understand,
Calligra also consider ODT as a native format, this example is of course a
mistake if I am wrong), then I would not see a problem if it opened in any
of these. If I have both GIMP and Krita installed and I double-click a PSD,
I would understand if it opens any of these. And so on. If the default is
not the one I expected, I would make a setting, but that's a perfectly
acceptable "mistake" IMO ("mistake" in quote, because it's not even a
mistake to me, the OS cannot be in my head and both these software are
intended to work on PSD-like files and support PSD).

Now of course, maybe we can improve the decision strategy. Say I have both
GIMP and Krita installed, but I use GIMP all the time, if my desktop were
recording such usage, it could decide in favor of GIMP the first time I
ever open a PSD (for which both programs would be registered as being of
similar intent). Basically simple machine learning based on usage
statistics.

Do we want to go that way (basic "usage learning" inside the desktop)? I
don't know, I was only giving some ideas as I'm asked to propose something.

But even without going to such extent, I am not looking for perfect
defaults choice (neither software-guided nor human-guided), only avoiding
the absurd ones.
And my belief is that human guided defaults will never be perfect either
anyway, because just anyone has different expectations.

Now someone was also proposing to always ask people. The proposition is
interesting, and I definitely understand both the people who want this and
the people who dread the idea. I am personally fine with defaults which are
globally good most of the time, and sometimes are not what I wanted, as
long as it's an acceptable mistake (i.e. not the weird cases above, which
all of us have experienced at some point in our years of usage). With such
logics (right most of the time, wrong sometimes, then I just add custom
rules), there is definitely less disturbance in my work rather than always
being popped up to choose for every new format.

So I guess my point is: don't look for perfection because it doesn't exist;
and if we ask software developers to make the choice, it can only fail. But
we can avoid the easy pitfalls by having developers document (through
metadata) what their software is intended to work on.

If you don't define it, then it'll be the current solution which is either
Post by Jehan Pagès
"random" or "first one alphabetically". Does it really make sense for abiword
to be the default word processor on all linux distributions, just because it
starts with an 'a'?
Post by Jehan Pagès
No if you include concepts of "priority" or "preferences", this is not
about being reasonable anymore. I would be perfectly reasonable to set
high
Post by Jehan Pagès
priority to GIMP because that's what I use daily, I work with it, that's
what I actually want to open or show higher in right-click menus. This
would be reasonable. I mean, you asked me my preferences! 🙄 Seriously,
that's my true personal preferences!
Surely you are able to distinguish your preferences as a user from what the
default preference should be for the majority of users.
Post by Jehan Pagès
Also go to Calligra developers and tell them that they are less popular
than LibreOffice, so it's perfectly reasonable for them to put themselves
in low priority. Let's see what they say.
I am a Calligra developer. Well, used to be, but I know very well the other
developers, and I have zero doubts that they would agree that Calligra in its
current state should not be the default for new users who have LibreOffice
installed. It would be extremely foolish to pretend otherwise, and they know
that.
Post by Jehan Pagès
By the way, did you know that OpenOffice is still more popular than
LibreOffice (maybe not in Linux, but all-platform alike, in sheer number;
at least that's what I was told). So go tell LibreOffice too that they
would be reasonable to put themselves down a bit.
Obviously all this is only about "free desktops", not about platforms who
don't even care about desktop files. Please stop jumping at me for using the
word "popular" as *one* of the criteria, as if I used it as the *only*
criteria.
I wanted to answer this part the most to clarify: I am not jumping at you.
Sorry that it looked that way. 🙇
I can be a bit passionate, that's all, and I always write a bit too much
(even this email, I said I'd make a short answer and here it is! Long with
too many parts answered). Anyway yes, I even actually appreciated that your
email at least came back to the original proposition because the whole
thread diverged quite a lot. 🙂
Post by Jehan Pagès
And the majority of Linux distributions ships LibreOffice, not OpenOffice,
right? So this would be moot anyway, the numbers only make a difference if
both are installed.
Post by Jehan Pagès
Really nothing is reasonable here. Don't ask developers to prioritize
themselves and relatively to other. Just ask them to tell "what's my
software main intent files?" **This** is reasonable.
It might be, but it doesn't solve the problem.
What's the point in adding complexity if it doesn't actually solve the
problem?
Post by Jehan Pagès
Then for more defaulting, let desktop put their own little priority list
(as they already do), and finally let the user make the final choice (as
already possible) if one installed several software of similar intents.
**This too** is reasonable.
I have made my case, you have made yours, I think at this point we need
external input. If other people with experience with this topic (e.g.
developers of desktop environments or distributors dealing with this topic)
agree with you that 3 levels are enough, I will be reasonable and I will drop
pushing for more flexibility.
Yes let's wait for more input.

But seriously, if I were asked to note all our supported formats on a scale
from 0 to 20, I would rather not use this at all. Just the idea that doing
this might put us in an awkward situation of comparing our support to other
software is enough to make me not want to do this, and I am dreading in
advance people attacking us with this (yes, I have become sensitive to this
type of things while working on such a known software and I became very
careful because some people are just waiting for us to make any mistake).
Also not even taking into account the amount of time it will imply to do it
right for the few dozens file formats supported.

Jehan
Post by Jehan Pagès
Post by Jehan Pagès
I would have seriously no idea how to number most formats. We would end
up
Post by Jehan Pagès
not using it. That's not good. 🀷
* 15-25 (default 20) for native mimetypes
* 5-15 (default 10) for mimetypes you want your app to be used for by default
* 5 if you don't specify anything
* 1-4 if you purposely want to make sure your app have very little chance of
being used by default for this mimetype (like LibreOffice for text/plain).
So, on day one, you'd only use 20, 10, 5 as per my earlier example.
But as time goes, tweaks would be possible, depending on what other
applications exist for those mimetypes and what makes most sense for the
default ordering.
The alternative is to define this (the ordering of apps for a mimetype)
outside the app desktop file, more globally, that's exactly what I thought
distros would do in their mimeapps.lst global file, but in this thread some of
them are clearly saying "nope, it's not our job". So all I see is people
refusing responsibility on this topic....
The one thing that helps a little bit in all this is that not everything is
installed by default, so the "conflict" between apps only exists between apps
that were pre-installed, or with apps that were manually installed on top for
one purpose and end up taking over unwanted mimetypes (like your GIMP example
I suppose). So there's no need for anyone to decide if abiword is better than
calligra because most users don't install both, I suppose. This is probably
why distros don't see how to write out a full mimeapps.lst. But they could
still ensure GIMP isn't the preferred app for PNGs, by listing all image
viewers before gimp :). You and me are suggesting that the image viewers
themselves are able to say in their desktop file that they should be preferred
over GIMP. We "only" disagree on the granularity of that information, but the
overall idea is similar. Now that we both presented our version of this idea,
I think we need input from other people, as stated above :)
Thanks,
--
Working on KDE Frameworks 5
--
ZeMarmot open animation film
http://film.zemarmot.net
Liberapay: https://liberapay.com/ZeMarmot/
Patreon: https://patreon.com/zemarmot
Tipeee: https://www.tipeee.com/zemarmot
Eli Schwartz
2021-05-03 19:36:03 UTC
Permalink
Post by David Faure
I understand. But then, if
* the distro doesn't want to choose
* the user hasn't made any specific choice
* the application developers are not the best candidate for choosing
then who remains? :)
I do in fact have a proposal!

Step 1)

In the mime apps spec, remove:

Once all levels have been checked, if no entry could be found, the
implementations can pick any of the .desktop files associated with the
mimetype, taking into account added and removed associations as per the
next section.

And replace it with:

Once all levels have been checked, if no entry could be found, the
implementations MUST query the user to pick one of the .desktop files
associated with the mimetype, taking into account added and removed
associations as per the next section. Optionally, the implementation may
and probably should then default to saving this to "user overrides
(recommended location for user configuration GUIs)".

Step 2)

In the xdg-open program, update open_generic() to comply with the new
version of the mime apps spec, by e.g. spawning a zenity selection
dialog. If zenity is not installed, a CLI dialog could be printed, but
this won't work well if stdout is not a tty... I believe that KDE has a
native equivalent to zenity but I'm not sure what that is, and anyway
open_generic is particularly for the case where you're not running a
recognizable DE, or are running anything other than KDE and the native
opener is not installed.

Step 3)

Open feature requests for DE-specific openers to implement the new
version of the mime apps spec.

Step 4)

Bask in the gratefulness of people who no longer get surprising behavior
but are instead asked what they want.

...

This change may very well obsolete much of the micro industry that has
grown up around xdg-open, where the sole purpose of a program is to
provide an alternative xdg-open that does not respect the xdg mimeapps
spec, but uses custom rules (generally a mix of regex and desktop entry
hints) and prompts the user on ambiguity, because their authors are
positive that xdg-open is the literal devil and will never open the
right thing ever.

Because people don't understand how "the implementations can pick any"
works, or they do understand it and it horrified them so much that they
ran screaming in the opposite direction.

:)

And then there is mimeo, a program that lets you take a desktop file and
add default associations for it, for every mimetype matching, say,
'glob:text/*'. Because if you don't whack mimeapps.list with a big stick
and add user preferences for every mimetype known to man, you might end
up in the tragic situation where some implementation of some spec tries
to randomly guess for you, so let's better set all the ones you don't
use just in case someday you do use it. "Better safe than sorry."
Post by David Faure
In the end I think
1) desktop environments can provide a mimeapps-$desktop.lst for distros to use
They could, but this is IMO only suitable for mimetypes like
inode/directory, about which I'll once more repeat my very early
Post by David Faure
The problem is IMHO most hilariously noticeable when some innocent
program declares there are certain conditions in which it can handle
"inode/directory", and then it mysteriously hijacks the job of the file
browser itself.
https://bugs.archlinux.org/task/30034
https://bugs.archlinux.org/task/54894#comment159599
https://bugs.archlinux.org/task/35528#comment162294
- a DE to define preferred default handlers in $DE-mimeapps.list
- an OS to define preferred default handlers in mimeapps.list
The former is, well, kind of a solution, you can at least solve the
inode/directory problem by force-associating the DE's native file
browser for this one mimetype.
For inode/directory, it's indeed appropriate for a DE to assume anyone
running this DE will be using this file browser too (and the file
browser must be installed as a dependency regardless).
Post by David Faure
2) users will still have to do some adjustments, especially when using distros
who didn't want to decide for them.
I'm very much in favor of users doing some adjustments! But they need to
be prompted into doing adjustments whenever those adjustments are
relevant, rather than letting the spec permit implementations to
mistreat the user and do the wrong thing.
Post by David Faure
The old debate of View vs Edit doesn't really solve this, as someone mentioned
here, different apps have different features, which goes far beyond View or
Edit.
It's just a very limited attempt to add even more confusing rules to
auto-guess the user's intent rather than biting the bullet and *asking*
them. So, unsurprisingly, it has shortcomings and different scopes which
render these definitions confusing... all of which could be solved by
not asking the application vendor, but asking the user instead.
--
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User
Thomas Kluyver
2021-05-04 09:27:38 UTC
Permalink
Post by Eli Schwartz
Once all levels have been checked, if no entry could be found, the
implementations MUST query the user to pick one of the .desktop files
associated with the mimetype, taking into account added and removed
associations as per the next section. Optionally, the implementation may
and probably should then default to saving this to "user overrides
(recommended location for user configuration GUIs)".
I don't think there's really any point writing MUST. The spec can recommend things, but no-one can force desktops to follow it if they don't think that behaviour provides the best experience. There's certainly a case for prompting the user to decide, but the place to make that case first is to the desktops which could actually implement it (assuming most users don't reach the generic fallback in xdg-open).
Post by Eli Schwartz
In the xdg-open program, update open_generic() to comply with the new
version of the mime apps spec, by e.g. spawning a zenity selection
dialog. If zenity is not installed, a CLI dialog could be printed...
I suspect that adding pop-up dialogs to something that didn't previously use them is going to cause some issues. It also means that you would need another level of detection & fallback (zenity/kdialog, terminal prompts) inside what's already a fallback. And you probably still want an ultimate fallback where none of the GUI dialog tools are available and it's not running in a tty.
Post by Eli Schwartz
This change may very well obsolete much of the micro industry that has
grown up around xdg-open, where the sole purpose of a program is to
provide an alternative xdg-open that does not respect the xdg mimeapps
spec, but uses custom rules (generally a mix of regex and desktop entry
hints) and prompts the user on ambiguity, because their authors are
positive that xdg-open is the literal devil and will never open the
right thing ever.
I may be wrong, but I'd guess that the mystery of xdg-open is more because it's a wrapper around a bunch of different desktop-specific tools with their own peculiarities. xdg-open could be effectively a different tool on my machine and yours, even if we have the same xdg-utils package from the same distro. Maybe it would have been better to implement xdg-open as a standalone tool rather than a wrapper around desktop tools, but I imagine that ship has long since sailed.

(And of course, there's nothing particularly wrong with people using other launcher tools if they want to - though I agree it's worth thinking about whether that points to problems with the default mechanisms.)

Thomas
Stefan Blachmann
2021-05-04 14:05:20 UTC
Permalink
When I search the web, I find little information about this topic, so
I am not sure whether I understand you all correctly.
If anybody can give me a pointer where I can read about xdg-open
(documentation, specifications, etc), I'd be grateful.

Here my thoughts:
Shouldn't the DE, respective the file manager keep a LRU sorted list
of applications for each mime/file type, so that it sort of
"memorizes" and respect the users' favorite apps?
So the list of the applications shown on "Open With" should reflect
what the particular user *actually* prefers to use, and present this
topmost.

Some, like KDE, do not do this. So the user often has to go through
the app choosing menus each and every time (s)he wants to open a
particular file type.

This is very annoying.
But imho it's an implementation deficiency of the DE and not of the
specification.

Just to use the initial example of XCF files: if you want to just view
the file, using GIMP is overkill over using a simple viewer app.
So, the imho initial proposal would add a *lot* of complexity, only to
be overridden by the individual users' choice anyway.

However, for this to work, the particular DE/application chooser must
not be deficient, instead it must store the users' choices in its LRU
list for later invocations.

Imho xdg-open should just ask the interface script of the current DE
or application chooser for the preference-sorted app list for the
particular file/mime type, and use that list.
The DE/application chooser should remember the individual users'
choices, to respect these in subsequent invocations.

Again, I believe the problem is not the standard, but the laziness of
the DE/application choosers not to store/memorize the previous user
choices.

So I am not sure what to think about a real solution to that
long-standing issue.

Wouldn't it be a better solution to add a specification in XDG that
defines how to store individual users' application preference LRU
lists for each mime/file type, which thus can keep the individual
users' preferences, even when switching to another DE/application
chooser?
Post by Thomas Kluyver
Post by Eli Schwartz
Once all levels have been checked, if no entry could be found, the
implementations MUST query the user to pick one of the .desktop files
associated with the mimetype, taking into account added and removed
associations as per the next section. Optionally, the implementation may
and probably should then default to saving this to "user overrides
(recommended location for user configuration GUIs)".
I don't think there's really any point writing MUST. The spec can recommend
things, but no-one can force desktops to follow it if they don't think that
behaviour provides the best experience. There's certainly a case for
prompting the user to decide, but the place to make that case first is to
the desktops which could actually implement it (assuming most users don't
reach the generic fallback in xdg-open).
Post by Eli Schwartz
In the xdg-open program, update open_generic() to comply with the new
version of the mime apps spec, by e.g. spawning a zenity selection
dialog. If zenity is not installed, a CLI dialog could be printed...
I suspect that adding pop-up dialogs to something that didn't previously use
them is going to cause some issues. It also means that you would need
another level of detection & fallback (zenity/kdialog, terminal prompts)
inside what's already a fallback. And you probably still want an ultimate
fallback where none of the GUI dialog tools are available and it's not
running in a tty.
Post by Eli Schwartz
This change may very well obsolete much of the micro industry that has
grown up around xdg-open, where the sole purpose of a program is to
provide an alternative xdg-open that does not respect the xdg mimeapps
spec, but uses custom rules (generally a mix of regex and desktop entry
hints) and prompts the user on ambiguity, because their authors are
positive that xdg-open is the literal devil and will never open the
right thing ever.
I may be wrong, but I'd guess that the mystery of xdg-open is more because
it's a wrapper around a bunch of different desktop-specific tools with their
own peculiarities. xdg-open could be effectively a different tool on my
machine and yours, even if we have the same xdg-utils package from the same
distro. Maybe it would have been better to implement xdg-open as a
standalone tool rather than a wrapper around desktop tools, but I imagine
that ship has long since sailed.
(And of course, there's nothing particularly wrong with people using other
launcher tools if they want to - though I agree it's worth thinking about
whether that points to problems with the default mechanisms.)
Thomas
Stefan Blachmann
2021-05-05 17:16:34 UTC
Permalink
I have looked at the xdg-open script.

I'd like best if I could just set an environment variable XDG_OPEN to
another program.
So xdg-open just passes through to my script.

I ask because, instead of using xdg-open, I would like to use my
personal app chooser for my Meow&Purr menu+filebrowser for FVWM.
Meow&Purr keeps LRU lists for the preferred apps for every and each
mime/file type.
So the default app is the last-used for any particular file type, and
the most-recently used apps for that file type are always at top in
the OpenWith list.
This solution imho best adapts to the users' personal preferences.

Because, who doesn't hate the bad UX when, for example xdg-open thinks
GIMP is the right app to view a PDF file :)

So I kindly ask, could there be added such an environment variable
XDG_OPEN specifying an alternative handler, to allow non-mainstream
DE/WMs handle the open dialog themselves?
Post by Stefan Blachmann
When I search the web, I find little information about this topic, so
I am not sure whether I understand you all correctly.
If anybody can give me a pointer where I can read about xdg-open
(documentation, specifications, etc), I'd be grateful.
Shouldn't the DE, respective the file manager keep a LRU sorted list
of applications for each mime/file type, so that it sort of
"memorizes" and respect the users' favorite apps?
So the list of the applications shown on "Open With" should reflect
what the particular user *actually* prefers to use, and present this
topmost.
Some, like KDE, do not do this. So the user often has to go through
the app choosing menus each and every time (s)he wants to open a
particular file type.
This is very annoying.
But imho it's an implementation deficiency of the DE and not of the
specification.
Just to use the initial example of XCF files: if you want to just view
the file, using GIMP is overkill over using a simple viewer app.
So, the imho initial proposal would add a *lot* of complexity, only to
be overridden by the individual users' choice anyway.
However, for this to work, the particular DE/application chooser must
not be deficient, instead it must store the users' choices in its LRU
list for later invocations.
Imho xdg-open should just ask the interface script of the current DE
or application chooser for the preference-sorted app list for the
particular file/mime type, and use that list.
The DE/application chooser should remember the individual users'
choices, to respect these in subsequent invocations.
Again, I believe the problem is not the standard, but the laziness of
the DE/application choosers not to store/memorize the previous user
choices.
So I am not sure what to think about a real solution to that
long-standing issue.
Wouldn't it be a better solution to add a specification in XDG that
defines how to store individual users' application preference LRU
lists for each mime/file type, which thus can keep the individual
users' preferences, even when switching to another DE/application
chooser?
Post by Thomas Kluyver
Post by Eli Schwartz
Once all levels have been checked, if no entry could be found, the
implementations MUST query the user to pick one of the .desktop files
associated with the mimetype, taking into account added and removed
associations as per the next section. Optionally, the implementation may
and probably should then default to saving this to "user overrides
(recommended location for user configuration GUIs)".
I don't think there's really any point writing MUST. The spec can recommend
things, but no-one can force desktops to follow it if they don't think that
behaviour provides the best experience. There's certainly a case for
prompting the user to decide, but the place to make that case first is to
the desktops which could actually implement it (assuming most users don't
reach the generic fallback in xdg-open).
Post by Eli Schwartz
In the xdg-open program, update open_generic() to comply with the new
version of the mime apps spec, by e.g. spawning a zenity selection
dialog. If zenity is not installed, a CLI dialog could be printed...
I suspect that adding pop-up dialogs to something that didn't previously use
them is going to cause some issues. It also means that you would need
another level of detection & fallback (zenity/kdialog, terminal prompts)
inside what's already a fallback. And you probably still want an ultimate
fallback where none of the GUI dialog tools are available and it's not
running in a tty.
Post by Eli Schwartz
This change may very well obsolete much of the micro industry that has
grown up around xdg-open, where the sole purpose of a program is to
provide an alternative xdg-open that does not respect the xdg mimeapps
spec, but uses custom rules (generally a mix of regex and desktop entry
hints) and prompts the user on ambiguity, because their authors are
positive that xdg-open is the literal devil and will never open the
right thing ever.
I may be wrong, but I'd guess that the mystery of xdg-open is more because
it's a wrapper around a bunch of different desktop-specific tools with their
own peculiarities. xdg-open could be effectively a different tool on my
machine and yours, even if we have the same xdg-utils package from the same
distro. Maybe it would have been better to implement xdg-open as a
standalone tool rather than a wrapper around desktop tools, but I imagine
that ship has long since sailed.
(And of course, there's nothing particularly wrong with people using other
launcher tools if they want to - though I agree it's worth thinking about
whether that points to problems with the default mechanisms.)
Thomas
David Faure
2021-05-08 08:48:48 UTC
Permalink
Post by Stefan Blachmann
I have looked at the xdg-open script.
I'd like best if I could just set an environment variable XDG_OPEN to
another program.
So xdg-open just passes through to my script.
This makes sense. In theory all implementations called by xdg-open implement
the same spec, but not the "desktop-specific fallbacks". So it makes
sense to redirect to your own implementation in other desktop environments.
Post by Stefan Blachmann
So I kindly ask, could there be added such an environment variable
XDG_OPEN specifying an alternative handler, to allow non-mainstream
DE/WMs handle the open dialog themselves?
Make a merge request for https://gitlab.freedesktop.org/xdg/xdg-utils/
--
David Faure, ***@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
Stefan Blachmann
2021-05-08 19:39:23 UTC
Permalink
Good suggestion! Will do that!
Post by David Faure
Post by Stefan Blachmann
I have looked at the xdg-open script.
I'd like best if I could just set an environment variable XDG_OPEN to
another program.
So xdg-open just passes through to my script.
This makes sense. In theory all implementations called by xdg-open implement
the same spec, but not the "desktop-specific fallbacks". So it makes
sense to redirect to your own implementation in other desktop environments.
Post by Stefan Blachmann
So I kindly ask, could there be added such an environment variable
XDG_OPEN specifying an alternative handler, to allow non-mainstream
DE/WMs handle the open dialog themselves?
Make a merge request for https://gitlab.freedesktop.org/xdg/xdg-utils/
--
Working on KDE Frameworks 5
David Faure
2021-05-08 08:45:46 UTC
Permalink
Post by Stefan Blachmann
Shouldn't the DE, respective the file manager keep a LRU sorted list
of applications for each mime/file type, so that it sort of
"memorizes" and respect the users' favorite apps?
So the list of the applications shown on "Open With" should reflect
what the particular user *actually* prefers to use, and present this
topmost.
Some, like KDE, do not do this. So the user often has to go through
the app choosing menus each and every time (s)he wants to open a
particular file type.
This is very annoying.
On the other hand, if I alternate between three different video editors,
it would be very annoying if they would keep switching places in the "Open
With" menu. This isn't the place to discuss user interfaces, but since you
want to standardize a LRU list, let me just object to the whole idea :)
If the user prefers a single application, they can easily change the settings
to make it the default one. If the user wants to juggle multiple application,
they can actually define the order they want in the Open With menu,
by reordering the apps in the settings dialog. This is IMHO much better
than a constantly reordering LRU list.
--
David Faure, ***@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
Thayne McCombs
2021-05-07 06:30:36 UTC
Permalink
Post by Eli Schwartz
And then there is mimeo, a program that lets you take a desktop file and
add default associations for it, for every mimetype matching, say,
'glob:text/*'. Because if you don't whack mimeapps.list with a big stick
and add user preferences for every mimetype known to man, you might end
up in the tragic situation where some implementation of some spec tries
to randomly guess for you, so let's better set all the ones you don't
use just in case someday you do use it. "Better safe than sorry."
On a tangent, the inability to set a preferred application for wildcard mime
types like text/* and image/* is a big pain point for me.

I open text files in a lot of different formats, and I'd like to be able
to open
them all with the same editor, but adding an entry for every text/*
entry that I
could ever possibly use to my mimeapps.list is quite a pain.
Stefan Blachmann
2021-05-07 10:18:09 UTC
Permalink
Post by Thayne McCombs
I open text files in a lot of different formats, and I'd like to be able
to open
them all with the same editor, but adding an entry for every text/*
entry that I
could ever possibly use to my mimeapps.list is quite a pain.
This is why my opinion is that the correct and simplest way to deal
with that mess is not introducing more complicated configuration
bureaucracy, instead just respecting (e.g. memorizing) your preference
for each file type/format you showed by using OpenWith.

(That problem annoyed me much, and the desire of having some "Recently
used/opened" mechanisms was one of the reasons why I wrote my own
solution "Meow&Purr", a complete replacement for xdg-menu for FVWM.)

Again my question:
What is the correct way to make xdg-open pass through to my script?

Because, as far as I can see, without a defined mechanism to do this,
my only option would be to delete/replace the xdg-open file.
Which is no good solution because it causes conflicts with package managers etc.
Thayne
2021-05-07 14:16:07 UTC
Permalink
Post by Stefan Blachmann
Post by Thayne McCombs
I open text files in a lot of different formats, and I'd like to be able
to open
them all with the same editor, but adding an entry for every text/*
entry that I
could ever possibly use to my mimeapps.list is quite a pain.
This is why my opinion is that the correct and simplest way to deal
with that mess is not introducing more complicated configuration
bureaucracy, instead just respecting (e.g. memorizing) your preference
for each file type/format you showed by using OpenWith.
But I don't want to be prompted seperately for every text type. I just want
to set the default for text/* once. I don't disagree with prompting the
user and storing the result, but that is orthogonal to being able to make a
default application for a wildcard. The prompt could even have an option to
make the app the default for all text, all images, etc.

And of course if there is a more specific rule (for example, a rule for
text/css) that would have higher precedence than a wildcard rule
Marc Pervaz Boocha
2021-05-07 14:35:04 UTC
Permalink
Another option is maybe have an option in the the definition of
mimetypes xml files to have some kind of derivation. So all text/xml is
will be marked as text/plain for applications.
Post by Thayne McCombs
Post by Thayne McCombs
I open text files in a lot of different formats, and I'd like to
be able
Post by Thayne McCombs
to open
them all with the same editor, but adding an entry for every text/*
entry that I
could ever possibly use to my mimeapps.list is quite a pain.
This is why my opinion is that the correct and simplest way to deal
with that mess is not introducing more complicated configuration
bureaucracy, instead just respecting (e.g. memorizing) your preference
for each file type/format you showed by using OpenWith.
But I don't want to be prompted seperately for every text type. I just
want to set the default for text/* once. I don't disagree with prompting
the user and storing the result, but that is orthogonal to being able to
make a default application for a wildcard. The prompt could even have an
option to make the app the default for all text, all images, etc.
And of course if there is a more specific rule (for example, a rule for
text/css) that would have higher precedence than a wildcard rule
_______________________________________________
xdg mailing list
https://lists.freedesktop.org/mailman/listinfo/xdg
Thayne
2021-05-08 06:08:17 UTC
Permalink
Post by Marc Pervaz Boocha
Another option is maybe have an option in the the definition of
mimetypes xml files to have some kind of derivation. So all text/xml is
will be marked as text/plain for applications.
that seems more complicated to me than a system that uses the default app
for text/* if there isn't one assigned for text/xml at the same level, and
I'm not sure what the benefit is. Note that I'm only proposing that the
wildcard would be allowed as the entireity of the type after the slash.
David Faure
2021-05-08 08:42:01 UTC
Permalink
Post by Thayne
Post by Marc Pervaz Boocha
Another option is maybe have an option in the the definition of
mimetypes xml files to have some kind of derivation. So all text/xml is
will be marked as text/plain for applications.
that seems more complicated to me than a system that uses the default app
for text/* if there isn't one assigned for text/xml at the same level, and
I'm not sure what the benefit is. Note that I'm only proposing that the
wildcard would be allowed as the entireity of the type after the slash.
text/* kind of makes sense, but image/*, video/* or application/* doesn't,
there's no application that can for sure handle all of that.
So instead of a one-use-case wildcard support, the mimetype spec has support
for inheritance. If you associate any application with text/plain then it WILL
be associated indirectly with all text/* mimetypes.
--
David Faure, ***@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
Thayne
2021-05-09 05:09:05 UTC
Permalink
Thayne McCombs
Post by David Faure
Post by Thayne
Post by Marc Pervaz Boocha
Another option is maybe have an option in the the definition of
mimetypes xml files to have some kind of derivation. So all text/xml is
will be marked as text/plain for applications.
that seems more complicated to me than a system that uses the default app
for text/* if there isn't one assigned for text/xml at the same level,
and
Post by Thayne
I'm not sure what the benefit is. Note that I'm only proposing that the
wildcard would be allowed as the entireity of the type after the slash.
text/* kind of makes sense, but image/*, video/* or application/* doesn't,
there's no application that can for sure handle all of that.
So instead of a one-use-case wildcard support, the mimetype spec has support
for inheritance. If you associate any application with text/plain then it WILL
be associated indirectly with all text/* mimetypes.
application/* definitely doesn't make sense. But image/* and video/*
definitely do (as in I want to use application X to open any image type by
default, unless there is something more specific). I guess there is a
question of how to set up something where you have a viewer for image/*,
but then have some more niche formats opened by specific applications, such
as image/xcf with gimp.
Loading...