diff --git a/.config/waybar/config b/.config/waybar/config index f3dc04a..48612a6 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -25,7 +25,7 @@ "format": " {temperatureC}°C " }, "custom/spotify": { - "exec": "/home/logan/scripts/mediaplayer.py --player spotify --period 1 --width 18", + "exec": "/home/logan/scripts/mediaplayer.py --player spotifyd", "format": "{} ", "return-type": "json", "on-click": "playerctl play-pause", diff --git a/.config/waybar/style.css b/.config/waybar/style.css index 21aec0c..965ee12 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -23,7 +23,7 @@ window#waybar { /* Modules */ -#clock, #battery, #cpu, #memory, #disk, #temperature, #backlight, #network, #pulseaudio, #custom-media, #custom-launcher, #custom-power, #tray, #mode, #idle_inhibitor , #mpd, .custom-spotify { +#clock, #battery, #cpu, #memory, #disk, #temperature, #backlight, #network, #pulseaudio, #custom-media, #custom-launcher, #custom-power, #tray, #mode, #idle_inhibitor , #mpd, .custom-spotifyd { padding: 0 10px; margin: 0px 5px; background: #fbf1c7; diff --git a/scripts/mediaplayer.py b/scripts/mediaplayer.py index 9d422d5..c50b460 100755 --- a/scripts/mediaplayer.py +++ b/scripts/mediaplayer.py @@ -36,7 +36,8 @@ def print_every_second(width, period=1): print_thread.start() cache["i"] += 1 - cache["text"] = wrap_text(cache["formattedText"], width, cache["i"]) + if "formattedText" in cache: + cache["text"] = wrap_text(cache["formattedText"], width, cache["i"]) print_from_cache()