by fletchowns · 2y ago · 0 comments
For example, there's <https://github.com/altdesktop/playerctl>, which can control any MPRIS-compatible client: VLC, web browsers, different music players, mpd (with a plugin), etc.
MPRIS can also be used to e.g. allow controlling playback without unlocking the screen - the screen locker itself doesn't need elaborate support, something as simple as slock could be hacked to recognise a key combo and call out to playerctl; more fancy login managers/lockers could talk DBUS/MPRIS directly and even e.g. display album artwork.
Unfortunately, the standard doesn't seem to specify a simple way to indicate whether video is being played back, which could be a saner way to inform the screen locker; the actual protocol to directly inhibit locking is unfortunately a little bit insane.
Read the spec, there's probably some interesting ideas to explore: https://specifications.freedesktop.org/mpris-spec/latest/
And concerning your last point, are you advising someone that built at least one MPRIS tool to read the spec? :P
The whole comment was for the general HN audience who might not be aware of MPRIS.
The general problem I keep seeing is silos; we've had the XDG standards/specs for decades, yet keep reinventing new, stupid, and broken ways to do things. Under X11 it was normal that every window got a border; under Wayland, GNOME doesn't want to adopt a protocol where a window can ask the compositor to paint a basic border, instead tells SDL to link against libadwaita. XScreenSaver has been telling apps to do "while sleep 60; do xscreensaver-command --deactivate; done" which worked well enough for decades; to "modernise" that, we have a DBus protocol which makes an app grab a cookie, and if it fails to return it (e.g. because it crashed) - the screensaver remains inhibited forever. Trying to use (or improve upon) a FOSS desktop is death by a thousand papercuts.
Thank you for your work.