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
|
import time
|
||||||
from systemd import journal
|
from systemd import journal
|
||||||
|
|
||||||
logger = logging.getLogger("polybar-weather")
|
logger = logging.getLogger("weather")
|
||||||
|
|
||||||
|
|
||||||
def get_location():
|
def get_location():
|
||||||
|
@ -95,7 +95,7 @@ def update_status(status, output):
|
||||||
f.write(status)
|
f.write(status)
|
||||||
|
|
||||||
# Send it to polybar
|
# 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__":
|
if __name__ == "__main__":
|
|
@ -3,8 +3,6 @@ Description=i3 session
|
||||||
BindsTo=graphical-session.target
|
BindsTo=graphical-session.target
|
||||||
Wants=wallpaper.service
|
Wants=wallpaper.service
|
||||||
Wants=wallpaper.timer
|
Wants=wallpaper.timer
|
||||||
Wants=polybar-weather.service
|
|
||||||
Wants=polybar-weather.timer
|
|
||||||
Wants=polybar.service
|
Wants=polybar.service
|
||||||
Wants=i3-companion.service
|
Wants=i3-companion.service
|
||||||
Wants=misc-x.service
|
Wants=misc-x.service
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Update weather for Polybar
|
Description=Update weather
|
||||||
PartOf=graphical-session.target
|
PartOf=graphical-session.target
|
||||||
After=polybar.service
|
|
||||||
Requisite=polybar.service
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
# Get one from https://openweathermap.org/, it's free
|
# Get one from https://openweathermap.org/, it's free
|
||||||
Environment=OWM_API_KEY=81687c78e0376836871a6cb9fc347249
|
Environment=OWM_API_KEY=81687c78e0376836871a6cb9fc347249
|
||||||
ExecStart=/usr/bin/mkdir -p %t/i3
|
ExecStart=/usr/bin/mkdir -p %t/i3
|
||||||
ExecStart=%h/.config/i3/bin/polybar-weather
|
ExecStart=%h/.config/i3/bin/weather
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=false
|
RemainAfterExit=false
|
||||||
Restart=on-failure
|
Restart=on-failure
|
|
@ -5,11 +5,13 @@ Wants=autorandr.service
|
||||||
Wants=dunst.socket
|
Wants=dunst.socket
|
||||||
Wants=inputplug.service
|
Wants=inputplug.service
|
||||||
Wants=picom.service
|
Wants=picom.service
|
||||||
Wants=pulseaudio.socket
|
|
||||||
Wants=policykit-agent.service
|
Wants=policykit-agent.service
|
||||||
|
Wants=pulseaudio.socket
|
||||||
Wants=redshift.service
|
Wants=redshift.service
|
||||||
Wants=spotify-clean.timer
|
Wants=spotify-clean.timer
|
||||||
Wants=ssh-agent.service
|
Wants=ssh-agent.service
|
||||||
|
Wants=weather.service
|
||||||
|
Wants=weather.timer
|
||||||
Wants=xiccd.service
|
Wants=xiccd.service
|
||||||
Wants=xsettingsd.service
|
Wants=xsettingsd.service
|
||||||
Wants=xss-lock.service
|
Wants=xss-lock.service
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue