Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Make the "Music Player Daemon" text interactive #55

Open
liamnoone opened this issue Apr 16, 2014 · 2 comments
Open

Request: Make the "Music Player Daemon" text interactive #55

liamnoone opened this issue Apr 16, 2014 · 2 comments

Comments

@liamnoone
Copy link

I'm not explaining this well, but here it goes anyways.

It'd be great if there was a configuration option for what happens when you click the indicator title. In Unity/Pantheon (at least), you can click the name of the player (in the sound indicator dropdown) and it'll open up that player, which is especially helpful if it's closed.
So if I have VLC installed and listed, and I click on the VLC text, it'll launch/switch to VLC. It'd be good if you could add (for example) player = "sonata [or ncmpcpp]", click "Music Player Daemon" and it'll launch the provided application.

In addition, it'd be a nice aesthetic change to only display the controls when mpd is currently running.
Is this within the scope of MPRIS?

@liamnoone liamnoone changed the title Request: Make the indicator Request: Make the indicator interactive Apr 16, 2014
@liamnoone liamnoone changed the title Request: Make the indicator interactive Request: Make the "Music Player Daemon" text interactive Apr 16, 2014
@grawity
Copy link
Collaborator

grawity commented Apr 17, 2014

MPRIS2 does define a org.mpris.MediaPlayer2.CanRaise property, and a corresponding org.mpris.MediaPlayer2.Raise() method; it would be simple to implement them in mpDris2. (In fact, I did that while writing this reply.)

However, both Unity and the GNOME Shell's "Media player indicator" extension will prefer to activate the player app directly through its .desktop file. This means that if CanRaise was set to true, Unity would just try to start mpDris2 again (according to Exec=mpDris2). (In the current version, this would result in the new mpDris2 instance simply replacing the old one.) If you changed the Exec= line, then you could have Unity launch Sonata – but then it wouldn't launch mpDris2 itself.

I guess the 'replace' behaviour could become an option, like --replace in things like gnome-shell or gnome-settings-daemon, and a second mpDris2 instance could just run the "player" command, but I'm undecided whether this isn't too much of a hack...


As for when the controls are displayed, it depends entirely on the MPRIS client – e.g. GNOME Shell (still talking about the same extension) only displays controls for players it sees on the bus; I think Unity does pretty much the same.

This means that you should already see the desired behavior, as mpDris2 always releases the bus name when it loses connection, and only re-acquires it after reconnecting to mpd... (unless you're using a really old pre-0.1 release, that is.) You can check using dbus-monitor member=NameOwnerChanged or dbus-name -ew.

@eonpatapon
Copy link
Owner

Currently if mpDris2 didn't have a .desktop file the shell extension would try to call Raise() instead of running mpDris2 directly.

IIRC I prefer using the shell API to bring the application to the front so that the current workspace is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants