diff --git a/py3status/modules/playerctl.py b/py3status/modules/playerctl.py index 605317a884..1cf8ad27e3 100644 --- a/py3status/modules/playerctl.py +++ b/py3status/modules/playerctl.py @@ -24,6 +24,8 @@ *(default '[\?color=status [\?if=status=Playing > ][\?if=status=Paused \|\| ]' '[\?if=status=Stopped .. ][[{artist}][\?soft - ][{title}|{player}]]]')* format_player_separator: show separator if more than one player (default ' ') + player_hide_non_canplay: For hiding players which doesn't close mpris interface after media closing + (default ['chromium', 'chrome']) players: list of players to track. An empty list tracks all players (default []) seek_delta: time (in seconds) to change the playback's position by (default 5) thresholds: specify color thresholds to use for different placeholders @@ -98,6 +100,7 @@ class Py3status: r"[\?if=status=Stopped .. ][[{artist}][\?soft - ][{title}|{player}]]]" ) format_player_separator = " " + player_hide_non_canplay = ["chromium", "chrome"] players = [] seek_delta = 5 thresholds = {"status": [("Playing", "good"), ("Paused", "degraded"), ("Stopped", "bad")]} @@ -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 + and player.props.player_name in self.player_hide_non_canplay + ): + continue + player_data = self._get_player_data(player) # Check if the player should cause the module to continuously update