Comments (5)
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.
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.
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.
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.
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)
- Add support for mpdmomd and mpdfavd HOT 1
- Interactive search in artist list doesn't work anymore HOT 8
- Artist list exhibits stuttery scrolling behavior when scrolling with trackpad HOT 25
- tray (notification status bar) support HOT 3
- Artist List where Artist is just one alpha HOT 2
- Feedback on new album cover scaling algorithm HOT 5
- Server statistics are wrong when mounting a networked storage through `mpd` HOT 2
- Artist list does not restore previous position and fails to render completely HOT 3
- Small Dutch translation bugs HOT 3
- ALL item HOT 4
- Multiple selection HOT 3
- Window no longer fits on RasPi touchscreen HOT 4
- Artist search fails with hyphen HOT 2
- AttributeError: 'gi.repository.Adw' object has no attribute 'PreferencesDialog'. Did you mean: 'PreferencesWindow'? HOT 2
- Fails to connect if there are no songs in the music directory HOT 6
- streams support HOT 1
- playlists support HOT 1
- Scaling on smaller displays
- Missing output chooser in new versions HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plattenalbum.