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

--ignore-player flag dosen't work when player (-p) is set to playerctld #192

Closed
alkeryn opened this issue Sep 30, 2020 · 8 comments
Closed
Assignees
Milestone

Comments

@alkeryn
Copy link

alkeryn commented Sep 30, 2020

title is pretty explicit but here is an example :

playerctl -p playerctld --ignore-player=mpd play-pause

will play-pause mpd altough it should ignore it.

why would i want to do that is pretty simple.

i might want to play-pause the last active player that isn't chromium for example.

@acrisci
Copy link
Member

acrisci commented Sep 30, 2020

This is actually working as intended because playerctld counts as a player. So technically you have actually ignored the other player.

If you want playerctld to ignore a certain player, there's no way to do that right now. How would you like to accomplish that?

One option would be to have a config file at some standard location playerctld reads at startup. You could configure your list of ignored players in there.

@alkeryn
Copy link
Author

alkeryn commented Sep 30, 2020

Hey, thanks for the quick reply !

i guess one way to do it would be to maintain a fifo queue of active players and when the flag ignore is used it just go to the next but that would indeed require quite a lot of change.

it is quite sad that mpris dosen't do it by itself and we kind of have to poll dbus.
well that is to my current understanding of how this all works.

also i am not a big fan of using a config file for that purpose as in the ideal scenario i'd like to settup a keybind to toggle ignoring or not chromium, as sometime i might want to control a youtube playlist but that's not the case most of the time.

but don't feel pressured to do all that work if you don't feel like it is necessary.

@acrisci
Copy link
Member

acrisci commented Sep 30, 2020

It might be ok to add another meta-player like we have for %any called %active which you could use as a placeholder for the active player. This would still require a running playerctld, which exposes the active players as an ordered list over its dbus interface. Then select the head of the list after the filters have been applied and substitute that player if the list is not empty. Then this command would make sense and do what you expect:

playerctl -p %active --ignore-player=mpd play-pause

@alkeryn
Copy link
Author

alkeryn commented Sep 30, 2020

@acrisci yup this is a good idea, you summed it up better than i could
+1 if the playerctld list is by last used order i think ^
in that case i guess you could just use %active,chromium that way chromium would be selected only if it is alone.
otherwise it would be the last player used that isn't chromium / other.
i think this is the best of both worlds.

@acrisci
Copy link
Member

acrisci commented Sep 30, 2020

I would accept this feature into the project. I normally get around to things like this eventually, but if someone wants to take it up go ahead.

eskultety added a commit to eskultety/machine-setup that referenced this issue Oct 18, 2020
Spotify is active most of the time and spurious browser players
invocations like youtube are undesirable.

Keep this around until this issue is addressed:
altdesktop/playerctl#192

Signed-off-by: Erik Skultety <skultety.erik@gmail.com>
@acrisci acrisci added this to the 2.3.1 milestone Oct 30, 2020
@acrisci
Copy link
Member

acrisci commented Nov 4, 2020

I think I can get away with implementing this without any user changes. When playerctld is running, I can get the list of players to act on from there and the behavior described here will be the default behavior. That would also affect every command. So for instance, playerctl play without specifying any player would act on the active player by default as well, and the %any metaplayer would prioritize active players.

@acrisci acrisci closed this as completed in bfed117 Nov 7, 2020
@acrisci
Copy link
Member

acrisci commented Nov 7, 2020

I no longer recommend selecting playerctld in the list of players. Just have it running and then it will select players in order of activity after all the selection filters are applied.

I'm working on a way to enable playerctld for a user as a separate step.

@alkeryn
Copy link
Author

alkeryn commented Nov 8, 2020

Oh thank you for all the work ! :)

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

No branches or pull requests

2 participants