Moon-0xff / gnome-mpris-label

A music related GNOME extension.
GNU General Public License v3.0
51 stars 10 forks source link

Remove info when no music is playing #2

Closed Batwam closed 1 year ago

Batwam commented 1 year ago

Hello,

Amazing extension, I love it. Would it be possible to remove the text when the music isn't playing (ie paused)? Perhaps as an option? I note that the following command allows to check if the music is playing or not (in spotify in this example) gdbus call --session --dest org.mpris.MediaPlayer2.spotify --object-path /org/mpris/MediaPlayer2 --method org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player PlaybackStatus

Moon-0xff commented 1 year ago

It was an intended feature at some point. Probably had some trouble implementing it.

Batwam commented 1 year ago

Looks like it's possible. I've just had a go at it and it seems to work fine. See pull request: #3

Full disclosure, I have no experience with javascript, D-Bus calls or gnome extensions so, this may not be the prettiest implementation but it sure seems to work, maybe it will point you in the right direction :-)

Moon-0xff commented 1 year ago

3 was merged to main