Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.6k stars 705 forks source link

MPRIS: needs some improvements when more than one player is active #1954

Open rodrgz opened 1 year ago

rodrgz commented 1 year ago

I'm seeing some problems with the module, regarding having more than one track/video playing at the same time.

Situation 1:

  1. I put a song for example in mopidy, the MPRIS module indicates mopidy playing;
  2. Then, I open a video on youtube through the browser and the module stops indicating mopidy to indicate youtube, so far ok;
  3. The youtube video ends, and now the module should indicate mopidy, as it is playing, but it is empty. Re-indicating mopidy only if a pause/chanee song action is performed in mopidy.

Situation 2:

  1. I put a song for example in mopidy, the MPRIS module indicates mopidy playing;
  2. Then, I open a video on youtube through the browser and the module stops indicating mopidy to indicate youtube, so far ok;
  3. I pause the video. And there is no way for me to select mopidy to pause.

In this case, it might be interesting to order the mopidy player in the background to be the one playing at the moment. Sort by order: play → pause. One thing that would solve this, and I think it would look elegant, would be the possibility to switch between all the players with the mouse scroll.

siggsy commented 1 year ago

The problem also occurs when using ignored-players feature. For example:

After checking some documentation for playerctl it appears that this is an issue of the playerctld proxy since there is no way to control to which player it listens.

Taking into the consideration the original problem of multiple players, the use of the playerctld proxy should be avoided.

ItsFireStorm commented 1 week ago

For anyone looking for this, a potential "fix" is this.

You can keep the player hidden, but playerctld allows you to shift up or down the current players available. So whenever it disappears, you can use the following configuration to change the selected player to the one of your choosing.

"on-scroll-up": "playerctld shift"
"on-scroll-down": "playerctld unshift"

This is still a very improvised fix, as it would be better if MPRIS just ignored the player completely instead of hiding itself when an ignored player is playing audio.