weather: do not make it depend on polybar

It's not used only by polybar and can be run before or after it.
This commit is contained in:
Vincent Bernat 2021-12-26 14:56:06 +01:00
parent 4ec09efa25
commit 45ee293d35
5 changed files with 7 additions and 9 deletions

View file

@ -11,7 +11,7 @@ import subprocess
import time
from systemd import journal
logger = logging.getLogger("polybar-weather")
logger = logging.getLogger("weather")
def get_location():
@ -95,7 +95,7 @@ def update_status(status, output):
f.write(status)
# Send it to polybar
subprocess.run(["polybar-msg", "action", f"#weather.send.{status}"], check=True)
subprocess.run(["polybar-msg", "action", f"#weather.send.{status}"])
if __name__ == "__main__":

View file

@ -3,8 +3,6 @@ Description=i3 session
BindsTo=graphical-session.target
Wants=wallpaper.service
Wants=wallpaper.timer
Wants=polybar-weather.service
Wants=polybar-weather.timer
Wants=polybar.service
Wants=i3-companion.service
Wants=misc-x.service

View file

@ -1,14 +1,12 @@
[Unit]
Description=Update weather for Polybar
Description=Update weather
PartOf=graphical-session.target
After=polybar.service
Requisite=polybar.service
[Service]
# Get one from https://openweathermap.org/, it's free
Environment=OWM_API_KEY=81687c78e0376836871a6cb9fc347249
ExecStart=/usr/bin/mkdir -p %t/i3
ExecStart=%h/.config/i3/bin/polybar-weather
ExecStart=%h/.config/i3/bin/weather
Type=oneshot
RemainAfterExit=false
Restart=on-failure

View file

@ -5,11 +5,13 @@ Wants=autorandr.service
Wants=dunst.socket
Wants=inputplug.service
Wants=picom.service
Wants=pulseaudio.socket
Wants=policykit-agent.service
Wants=pulseaudio.socket
Wants=redshift.service
Wants=spotify-clean.timer
Wants=ssh-agent.service
Wants=weather.service
Wants=weather.timer
Wants=xiccd.service
Wants=xsettingsd.service
Wants=xss-lock.service