https://bugs.kde.org/show_bug.cgi?id=305136
--- Comment #13 from nyanpasu64 <nyanpas...@tuta.io> ---
Decided to install GNOME to see how it handles default applications. I had a
lot less "mishmash of broken settings and broken default applications" this
time around, compared to my last attempt at multiple DEs.

GNOME has a "Default Applications" settings page. It works by writing dozens of
file associations into ~/.config/mimeapps.list (this file applies to all DEs).
If you set VLC as your default audio player, GNOME will first set
"audio/x-vorbis+ogg" to launch VLC by default, then set every MIME type
supported by VLC matching "audio/*" to launch VLC by default (skipping VLC's
video MIME types, and audio/* MIME types that VLC doesn't support). This is a
useful tool to set default apps (though it doesn't have the option to exclude
specific file types from being assigned to your new default app, which is
sometimes useful). Unfortunately KDE has no equivalent convenient tool to
change MIME types. Fortunately gnome-control-center also changes default apps
in KDE, though it might come with a lot of GNOME dependencies (not sure).

In summary, GNOME doesn't follow InitialPreference like KDE does, resulting in
suboptimal file associations. However GNOME makes it easy (unlike in KDE) for
each user to set entire categories of MIME types to a single default app. (IDK
if GNOME updates your account-local mimeapps.list's [Added Associations] or
[Default Applications] when you install or uninstall apps.) So merely
installing GNOME and setting default apps once is enough to fix file
associations globally in all DEs, for as long as you use the same computer and
user account. (There's a *lot* more depth including bugs where GNOME mixes up
MIME aliases, but I don't know where to publish my writeup or whether to file a
bug report.)

I don't know if GNOME defaults to something dumb (like Wine Internet Explorer)
for PDF files by default though, requiring manual fixing for each filetype
(which is worse than KDE using good defaults out of the box).

I still don't know the best route to take from now on, whether to convince
GNOME to support InitialPreference, to write my own converter from
InitialPreference to mimeapps.list, or from InitialPreference to mimeinfo.cache
(replacing update-desktop-database).

----

Also, I think KDE needs an equivalent to GNOME's "Default Applications"
settings page. (There's an old closed bug at
https://bugs.kde.org/show_bug.cgi?id=211147, mentioning default images/videos
which can be implemented like GNOME, but also default office suites which is
more complex.)

KDE Default Applications's current architecture is located at
https://invent.kde.org/plasma/plasma-desktop/-/tree/master/kcms/componentchooser.
It uses one C++ class per item (eg. the default browser is controlled by
componentchooserbrowser.h/cpp) and hard-codes the logic used for each item. It
currently lacks any items which use globs to change many MIME types in bulk.
One way to rewrite it is in a more data-driven approach like GNOME's at
https://gitlab.gnome.org/GNOME/gnome-control-center/-/blob/6c816e79e83383c11a07ab6a734cd8350c6c330e/panels/default-apps/cc-default-apps-panel.c#L27-35.
However I don't know if doing so would lose out on functionality currently
unique to each C++ class, like ComponentChooserBrowser using a BrowserSettings
object.

It seems that KDE Default Applications (at least "Web browser" and "File
manager") also applies to other desktop environments, but I haven't researched
how/why.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to