diff --git a/bin/waybar_mediaplayer.py b/bin/waybar_mediaplayer.py index a7266ce..6a1f61c 100755 --- a/bin/waybar_mediaplayer.py +++ b/bin/waybar_mediaplayer.py @@ -15,9 +15,9 @@ def write_output(text, player): logger.info('Writing output') m = dict(player.props.metadata) - title = m.get("xesam:title", "unknown") - artist = ",".join(x for x in m.get("xesam:artist")) - album = m.get("xesam:album") + title = m.get("xesam:title", "None") + artist = ",".join(x for x in m.get("xesam:artist", ["None"])) + album = m.get("xesam:album", "None") tooltip = f" {artist}\n {title}\n {album}" output = {'text': text, 'tooltip': tooltip, diff --git a/waybar.d/config b/waybar.d/config index 7b18684..cf7fc19 100644 --- a/waybar.d/config +++ b/waybar.d/config @@ -105,8 +105,7 @@ "default": "♪ " }, "escape": true, - "exec": "$HOME/.config/sway/bin/waybar_mediaplayer.py 2> /dev/null", - "exec-if": "pgrep plexamp" + "exec": "$HOME/.config/sway/bin/waybar_mediaplayer.py 2> /dev/null" }, "clock": { "format": "{: %a, %b %d, %H:%M}", @@ -194,7 +193,7 @@ "car": "", "default": ["", "", ""] }, - "min-length": 14, + "min-length": 9, "max-length": 20, "on-click": "$HOME/.config/sway/bin/sway_volume mute", "on-click-middle": "$HOME/.config/sway/bin/sway_volume gui", diff --git a/waybar.d/config_annoyance b/waybar.d/config_annoyance index d305098..4a162bf 100644 --- a/waybar.d/config_annoyance +++ b/waybar.d/config_annoyance @@ -102,8 +102,7 @@ "default": "♪ " }, "escape": true, - "exec": "$HOME/.config/sway/bin/waybar_mediaplayer.py 2> /dev/null", - "exec-if": "pgrep plexamp" + "exec": "$HOME/.config/sway/bin/waybar_mediaplayer.py 2> /dev/null" }, "clock": { "format": "{: %a, %b %d, %H:%M}", @@ -191,7 +190,7 @@ "car": "", "default": ["", "", ""] }, - "min-length": 14, + "min-length": 9, "max-length": 20, "on-click": "$HOME/.config/sway/bin/sway_volume mute", "on-click-middle": "$HOME/.config/sway/bin/sway_volume gui",