diff --git a/bin/polybar-weather b/bin/polybar-weather index 0e5bc95..a266292 100755 --- a/bin/polybar-weather +++ b/bin/polybar-weather @@ -152,11 +152,17 @@ if __name__ == "__main__": logger.info(f"current weather: {description}") # Format output - output = "{} {} {}".format( + forecasts = [ format_weather(forecast_weather["list"][0]), format_weather(forecast_weather["list"][1]), format_weather(forecast_weather["list"][2]), - ) + ] + while len(forecasts) >= 2: + if forecasts[-1] == forecasts[-2]: + forecasts.pop() + else: + break + output = " ".join(forecasts) output = output.replace("%{Tx}", "%%{T%d}" % options.font) logger.debug("output: %s", output) diff --git a/dotfiles/systemd/weather.service b/dotfiles/systemd/weather.service index ae775c8..d711d8c 100644 --- a/dotfiles/systemd/weather.service +++ b/dotfiles/systemd/weather.service @@ -1,5 +1,5 @@ [Unit] -Description=Build and display wallpaper +Description=Update weather for Polybar PartOf=graphical-session.target After=polybar.service