Bug 401604 - Please, give UI ability to manage `x-scheme-handler` MimeTypes, which would allow to integrate apps by "XDG Shared MIME-info Database specification" section "URI scheme handlers"
Summary: Please, give UI ability to manage `x-scheme-handler` MimeTypes, which would a...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_componentchooser (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-01 11:33 UTC by Anton Latuha
Modified: 2021-01-10 20:13 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:
bernie: Usability+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Latuha 2018-12-01 11:33:48 UTC
SUMMARY

Allow to manage MimeTypes `x-scheme-handler/x`.
To be able to pass to applications a custom protocols (URLs).

For example in `x-scheme-handler/x`, `x` can be:

  - magnet (for torrent magnet links),
  - spotify (spotify),
  - tg (telegram),
  - rtsp (real-time streaming protocol),
  - org-protocol (protocol to path through information to the Emacs Org).

STEPS TO REPRODUCE
1. Open Settings -> Application -> File Associations

OBSERVED RESULT

There is no `x-scheme-handler` section nor a possibility to create a handler.

EXPECTED RESULT

There to be `x-scheme-handler` section which shows the currently known protocols and allows to declare new ones/set default applications for them.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: current NixOS 19.03pre
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.51.0
Qt Version: 5.11.1

ADDITIONAL INFORMATION

Here I describe the current way to register `x-scheme-handler`.

I have not found the solid source of information to this process.
To set the connection between URL and application - user must make a pretty wide research, get the knowledge about desktop files, MimeTypes, how `x-scheme-handler` protocols work and get info on what to do.
Manually create the right `~/.local/share/applications/handler.desktop` entry.
Register the desktop entry with `kbuildsycoca5`.
Register the desktop entry with right xdg command, aka `xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol`

Only because found the next thread - managed to register `x-scheme-handler`, in the thread, you can see what it takes to discover the path I described:
https://lists.fedoraproject.org/archives/list/kde@lists.fedoraproject.org/thread/ZERZXDKGTJXBAEVMBTOAEI32EQ4VOK4L/


Thank you for everything.
Good day for you.
Comment 1 Anton Latukha 2019-10-27 17:27:28 UTC
These protocol handlers seem to be the good default interface to pass information between desktop applications, not relying on internal mechanics or particular code integration that expect particular applications to be installed and available. Relying only on the protocols for sending the information.

It can be seen as an analog of a Unix pipe shell for the desktop applications.
Comment 2 Anton Latukha 2019-10-27 18:13:57 UTC
This request, as I found-out, corresponds to "XDG Shared MIME-info Database specification", section "URI scheme handlers", and can be considered a request to have these settings available/editable in GUI form.

This request solves:

https://bugs.kde.org/show_bug.cgi?id=378647
https://bugs.kde.org/show_bug.cgi?id=292606
https://bugs.kde.org/show_bug.cgi?id=334440
https://bugs.kde.org/show_bug.cgi?id=148765

Also next are closely related, solutions may involve `x-scheme-handler`s:

https://bugs.kde.org/show_bug.cgi?id=148765
https://bugs.kde.org/show_bug.cgi?id=210304 (There is `feed://` handler, for example, I found that at least Outlook registers it)

There is a bunch of multimedia handlers I found, and content types (referring also to XDG spec, section "Content types for volumes"). The best news are - they are right-away already supported by many multimedia players, proof: https://wiki.debian.org/DebianMultimedia/PlayerSupport

Handlers listed on that info page are:
x-scheme-handler/mms
x-scheme-handler/rtmp
x-scheme-handler/rtsp
x-scheme-handler/mmsh
x-scheme-handler/rtp
x-scheme-handler/icy
x-scheme-handler/icyx
x-scheme-handler/pnm
x-scheme-handler/net
x-scheme-handler/rtspt
x-scheme-handler/rtspu
x-scheme-handler/uvox

x-content/video-dvd
x-content/video-svcd
x-content/video-vcd
x-content/audio-player
x-content/audio-dvd
x-content/audio-cdda

And the ability to set `x-content/audio-cdda` is towards solving: https://bugs.kde.org/show_bug.cgi?id=172995
Comment 3 Anton Latukha 2019-10-27 18:23:43 UTC
Observed that `Settings -> Applications -> File Association` already supports `x-content`, so request only asks to add `x-scheme-handler` there.
Comment 4 Bernie Innocenti 2020-03-28 14:35:35 UTC
I hit this today, and it's a usability issue for end-users:

1. install two apps which handle the same uri schema (e.g. transmission-qt and qbittorrent)

2. Now open a link in that scheme in your browser (or do "xdg-open magnet:blahblah:)

3. xdg-open will invoke this command and take the first output line, causing one of the two competing apps to be chosen:

  ktraderclient5 --mimetype x-scheme-handler/magnet --servicetype Application | grep ^DesktopEntryPath
Comment 5 Bernie Innocenti 2020-03-28 14:38:56 UTC
So, how could users reorder the apps in systemsettings? There's a way, but it's not immediately discoverable:

1. Go to systemsettings > Applications > File Associations and clicked "Add...".

2. In the Create New File Type dialog, manually type "x-scheme-handler" for the Group, and "magnet" for the Type (or whatever your url schema happens to be).

3. Wham! The group appeared and is already populated with the apps which registered for this url scheme.

4. Re-arrange the order as you wish and click Apply.

5. Now "xdg-mime query default x-scheme-handler/magnet" returns the first app.
Comment 6 Bernie Innocenti 2020-03-28 14:42:00 UTC
A possible fix for this bug would be pre-populating the x-scheme-handler group for all schemas that have some apps already registered.

Perhaps the url schemas should be moved somewhere else: from the user's PoV, these are "favorite app for urls of type X".
Comment 7 Anton Latukha 2020-03-30 16:14:13 UTC
1. Thank you for finding user-side workaround for this.

I would say more, this workaround is just undiscoverable for a user.

Even with your guidance I not immediately discovered that the "Group" list selector can accept the random text (aka `x-scheme-handler`) into itself (and not raise an error on Apply) and that it draws & populates the relevant information out of nowhere. One who can deduct this solution himself - is a person who knows the code of the Plasma applications and knows how XDG standards implemented in Plasma to even be able to deduct it.

2. This solution also does not solve the other half of the question - how user can see what `x-scheme-handler`s are registered.

Also that this question is still unsolved, shows that "Favorite apps" is not the place to present `x-scheme-handler` information, true maybe only for `magnet` links. Since that is the place only for the most crucial stuff. I think that `x-scheme-handler` information should be gathered and presented in the System Settings > Applications > File Associations > x-scheme-handler as all other MIME types do present there.

I would be happy with any solution to this, as I want to be able to register and manage `x-scheme-handler`s easily.
Comment 8 Anton Latukha 2021-01-10 20:13:52 UTC
Seems already became implemented.

Thank you.