-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
playerctl module: hide non-can-play players and use chrome and chromium as default value. #2256
playerctl module: hide non-can-play players and use chrome and chromium as default value. #2256
Conversation
a80ebcf
to
167cb32
Compare
…um as default value.
167cb32
to
d75ffb7
Compare
py3status/modules/playerctl.py
Outdated
@@ -273,6 +276,12 @@ def playerctl(self): | |||
players = [] | |||
cached_until = self.py3.CACHE_FOREVER | |||
for player in tracked_players: | |||
if ( | |||
not player.props.can_play |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without digging in, Is not player.props.can_play
alone enough without player_hide_non_canplay
config.... This seems like an mpris issue on chrome/chromium side.
Do chrome/chromium change this flag when it's playing/not playing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually there are other chromium based browsers like brave which has same bug. Chromium issue tracker has already bug in their system: https://issues.chromium.org/issues/40703847
Even the issue is from older raport states same issue: JasonLG1979/gnome-shell-extension-mpris-indicator-button#10
Added some pictures about different "can" properties:
State when chromium is playing media
State when chromium media is paused:
State when chromium mpris is idle state:
VLC is opened but no media opened (just opened vlc, no media selected):
VLC is opened, media loaded and stopped playing media.
I don't wan't to blindly hide all players with can_play == false state because I prefer to see VLC media player on statusbar just after I opened it as empty player.
It littlebit seems like hide_non_can_play is too technical so even we can simplify it to level: hide media players stopped state and user provides list on media players which he want to hide.
I searched some chromium source code and found out where this all "can" properties false comes. I suspect that line is this: https://source.chromium.org/chromium/chromium/src/+/main:components/system_media_controls/linux/system_media_controls_linux.cc;l=288
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been out of scene with py3status. Just sharing thoughts.
I think it doesn't benefit users to display empty players. If anything, this is maybe something that should be added in first place to ensure better quality control/behavior.
I do think hide_non_can_play
config is too specific that partially addresses chromium-based players and not that general... I would like an approach that that users can allow/deny (all) can_xxx_xxx
configs (either by a dict config or new placeholders). New placeholders that exposes boolean like this... is maybe hard for users to come up with a new format_player
that excludes those players... Dict may be be easier.
I prefer to see VLC media player on statusbar just after I opened it as empty player.
It should be easier to just ignore players that doesn't have can_play
flag true because of things like... You saying you don't like this empty-player thing on chrome/chromium #2255 but are okay with this on vlc... I think it would make more sense to avoid all empty-players in first place... to keep it simple.
This approach also may omit the need for adding |{player}
at end of format_player
config too.
Try it for a while. See if this small but simple tweak works quite well.
Is it fixable with # Hide on empty title, no player.
format_player = "[\?if=title [\?color=status [\?if=status=Playing > ][\?if=status=Paused \|\| ]"
format_player += "[\?if=status=Stopped .. ][[{artist}][\?soft - ]{title}]]]" |
@valdur55 do you want to follow up here before I do a release? |
Oh no, I totaly forgot this thread. I tested different desktop envs capabilities to handle this issue. Looks like winner is solution to hide paused media players, but there is one catch. @lasers your format_player magic didn't work for me. Player with media didn't show up. |
Thanks, will make a release soon |
Hey. Edit: already release. So till the next time. It isn't blocker. Btw in conclusion. There is no new parameter, just hiding all players with can_play = False property. |
Proposes improvement for issue #2255.