Looking at the MPRIS specification, it just states that music players should pick a unique bus name beginning with
org.mpris.MediaPlayer2.; there doesn’t seem to be any mention of desktop file names. So am I right in thinking this constraint is a KDE Plasma specific addition to the protocol? Player controls for running snapped music players show in gnome-shell, but it doesn’t seem to be trying to associate it with the original app.
This would definitely need some changes on the snapd side to support properly: it isn’t something that can be fobbed off to the snap maintainer. For example, lets say that the Spotify developers decided to modify the snapped version of their app to request the bus name corresponding to their snap desktop file name. That would be
org.mpris.MediaPlayer2.spotify_spotify, which is invalid due to the underscore.
foo_foo.desktop down to
foo.desktop might help in this specific case, but it isn’t the only point of friction for the current naming scheme. From what I can tell, the current naming scheme is based on the following requirements/assumptions:
- it shouldn’t be possible for two snaps to claim the same desktop ID.
- (unsure) The assigned desktop ID should be unlikely to conflict with applications on the host system.
- The specific desktop ID assigned to an application has no semantic meaning, besides being unique.
This is just another case where (3) is a bad assumption. Others that I’ve encountered include:
D-Bus activatable desktop files, offering a fast path for activating single instance apps or quicklist actions. In particular, this requires the desktop ID to be a valid D-Bus name, so the simple folding case isn’t enough.
- Cases where an the desktop ID of one app is hard coded into another app or service. For example, gnome-settings-daemon hard coding the IDs it tries to launch when the user presses the “calculator” key on their keyboard (currently patched in Ubuntu).
If we are going to change how this works, it’d be good to get some agreement over what the requirements actually are, and how they interact with other snapd features. For example, is it okay for parallel installs to break for apps that say their exact desktop ID is important?