From 7e9207d75cf8a19f5edc395a099bb0cc21c1ce86 Mon Sep 17 00:00:00 2001 From: Sibren Vasse Date: Wed, 31 Jul 2019 11:49:18 +0200 Subject: [PATCH 1/2] fix(custom): ignore selected_player if not defined. Fixes #419 --- resources/custom_modules/mediaplayer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/custom_modules/mediaplayer.py b/resources/custom_modules/mediaplayer.py index d9caacd..4d75a25 100755 --- a/resources/custom_modules/mediaplayer.py +++ b/resources/custom_modules/mediaplayer.py @@ -45,7 +45,7 @@ def on_metadata(player, metadata, manager): def on_player_appeared(manager, player, selected_player=None): - if player is not None and player.name == selected_player: + if player is not None and (selected_player is None or player.name == selected_player): init_player(manager, player) else: logger.debug("New player appeared, but it's not the selected player, skipping") From 12f869ccbaaf3c2e115fcfa10b9253fcdcf1bb93 Mon Sep 17 00:00:00 2001 From: Sibren Vasse Date: Wed, 31 Jul 2019 11:50:56 +0200 Subject: [PATCH 2/2] chore: add player filter example in config --- resources/config | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/config b/resources/config index f4ec2ff..8405562 100644 --- a/resources/config +++ b/resources/config @@ -140,5 +140,6 @@ }, "escape": true, "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name } }