mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-23 18:28:34 +02:00
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:
parent
4ec09efa25
commit
45ee293d35
5 changed files with 7 additions and 9 deletions
|
@ -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__":
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue