Giter Club home page Giter Club logo

Comments (5)

SoongNoonien avatar SoongNoonien commented on June 2, 2024

Would you be willing to reconsider this change?

I've made MPRIS optional again. I removed this option while reworking the settings because it was the only setting remaining which requires a restart of the program and I thought that it is not so important. Maybe I'll remove the need for restarting when I get to it. This should be relatively easy.

Also note that programs (such as the popular rescrobbled) might inspect MPRIS for e.g. last.fm scrobbling. Having an always-on MPRIS implementation at the mpd-level works better for use cases such as continuous MPRIS-based scrobbling.

Didn't know this existed. I only knew mpdscribble, but this is not very useful if multiple audio players are used.

I think outsourcing MPRIS to the mpd music server, instead of reinventing the wheel client-side, is actually more in line with the mpd philosophy, and also with the fact that plattenalbum desires to be small, simple, and easily maintainable.

But I don't like to install another client just for the MPRIS interface. I may be a fairly untypical MPD user but I only have one client in use. Another advantage of the integration of MPRIS inside Plattenalbum is that there is an actual association between the window of the client an the representation of the MPRIS controls in the desktop. In GNOME for example this has the effect that clicking on the MPRIS controls in the notification area brings the client to focus, which I use from time to time.

Indeed, glancing at the mpd clients on the arch wiki reveals that most — if not all? — lack their own MPRIS implementation.

Cantata has one. But it has some bugs which won't be fixed as it is unmaintained.

from plattenalbum.

rien333 avatar rien333 commented on June 2, 2024

In GNOME for example this has the effect that clicking on the MPRIS controls in the notification area brings the client to focus, which I use from time to time.

Yeah, this is something I miss with mpd-mpris!

Thanks for looking into this.

from plattenalbum.

rien333 avatar rien333 commented on June 2, 2024

In GNOME for example this has the effect that clicking on the MPRIS controls in the notification area brings the client to focus, which I use from time to time.

I made a silly patch that hacks this into mpd-mpris, since I do indeed like this functionality:

diff --git a/introspect.go b/introspect.go
index 63c688c..913f853 100644
--- a/introspect.go
+++ b/introspect.go
@@ -43,6 +43,11 @@ func (i *Instance) IntrospectNode() *introspect.Node {
 						Type:   "as",
 						Access: "read",
 					},
+					introspect.Property{
+						Name:   "DesktopEntry",
+						Type:   "as",
+						Access: "read",
+					},
 				},
 				Methods: []introspect.Method{
 					introspect.Method{

diff --git a/root.go b/root.go
index ad43163..767aed2 100644
--- a/root.go
+++ b/root.go
@@ -1,8 +1,6 @@
 package mpris
 
 import (
-	"fmt"
-
 	"github.com/godbus/dbus/v5"
 	"github.com/godbus/dbus/v5/prop"
 )
@@ -19,7 +17,8 @@ func (m *MediaPlayer2) properties() map[string]*prop.Prop {
 		"CanQuit":      newProp(false, nil),                                            // https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:CanQuit
 		"CanRaise":     newProp(false, nil),                                            // https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:CanRaise
 		"HasTrackList": newProp(false, nil),                                            // https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:HasTrackList
-		"Identity":     newProp(fmt.Sprintf("MPD on %s", m.Instance.mpd.Address), nil), // https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:Identity
+		"Identity":     newProp("Plattenalbum", nil), // https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:Identity
+		"DesktopEntry":  newProp("de.wagnermartin.Plattenalbum", nil), // https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:Identity
 		// Empty because we can't add arbitary files in...
 		"SupportedUriSchemes": newProp([]string{}, nil), // https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:SupportedUriSchemes
 		"SupportedMimeTypes":  newProp([]string{}, nil), // https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:SupportedMimeTypes

Works pretty well, though I've seen it fail when running mpd-mpris as a systemd daemon, for whatever reason. From my experience, this integration with Gnome requires the above Identity field to be equal to the Name field in the .desktop file.

from plattenalbum.

SoongNoonien avatar SoongNoonien commented on June 2, 2024

Why not propose this over on their github? Perhaps they could make this configurable so one can select an arbitrary .desktop file. But this could very well be out of scope for them.

from plattenalbum.

rien333 avatar rien333 commented on June 2, 2024

Perhaps they could make this configurable so one can select an arbitrary .desktop file.

That may well be a valid suggestion, thanks. I was worried it might be out of scope, however, since I'm not sure how exclusive this is to Gnome. Will do some more research!

from plattenalbum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.