summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2024-02-23 02:47:29 -0500
committerJesse Luehrs <doy@tozt.net>2024-02-23 02:47:29 -0500
commit1eb05e539ec54f404ae7367ba12233bbfebfdbf9 (patch)
treea66d4267ab803789e215efaf8747fba404b0c506
parent8a0e22d68add0ac8f6c488e73c22cf66fb78f12b (diff)
downloadconf-1eb05e539ec54f404ae7367ba12233bbfebfdbf9.tar.gz
conf-1eb05e539ec54f404ae7367ba12233bbfebfdbf9.zip
convert update-weather to systemd
-rw-r--r--cron/Makefile9
-rw-r--r--cron/crontab.stowskip1
-rw-r--r--i3status/.config/systemd/user/weather.service3
-rw-r--r--i3status/.config/systemd/user/weather.timer6
-rw-r--r--i3status/Makefile9
-rwxr-xr-xlocal/.bin/hornet/update-weather3
-rw-r--r--packages.hornet1
-rw-r--r--packages.mz-doy11
8 files changed, 20 insertions, 13 deletions
diff --git a/cron/Makefile b/cron/Makefile
deleted file mode 100644
index 22cd971..0000000
--- a/cron/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-include ../Makefile.include
-
-install: /var/spool/cron/$(USER)
-
-uninstall:
- @crontab -r
-
-/var/spool/cron/$(USER) : crontab.stowskip
- @crontab $<
diff --git a/cron/crontab.stowskip b/cron/crontab.stowskip
deleted file mode 100644
index 70e80b7..0000000
--- a/cron/crontab.stowskip
+++ /dev/null
@@ -1 +0,0 @@
-*/15 * * * * /bin/bash -c 'export PATH=~/.bin/$(hostname):~/.bin:/usr/bin:/usr/bin/vendor_perl:$PATH && update-weather'
diff --git a/i3status/.config/systemd/user/weather.service b/i3status/.config/systemd/user/weather.service
new file mode 100644
index 0000000..2351b21
--- /dev/null
+++ b/i3status/.config/systemd/user/weather.service
@@ -0,0 +1,3 @@
+[Service]
+Type=oneshot
+ExecStart=%h/.bin/%H/update-weather
diff --git a/i3status/.config/systemd/user/weather.timer b/i3status/.config/systemd/user/weather.timer
new file mode 100644
index 0000000..b90e4bf
--- /dev/null
+++ b/i3status/.config/systemd/user/weather.timer
@@ -0,0 +1,6 @@
+[Timer]
+OnStartupSec=0
+OnUnitActiveSec=900
+
+[Install]
+WantedBy=timers.target
diff --git a/i3status/Makefile b/i3status/Makefile
new file mode 100644
index 0000000..6627473
--- /dev/null
+++ b/i3status/Makefile
@@ -0,0 +1,9 @@
+include ../Makefile.include
+
+install:
+ @systemctl --user enable weather.timer
+ @systemctl --user start weather.timer
+
+uninstall:
+ @systemctl --user stop weather.timer
+ @systemctl --user disable weather.timer
diff --git a/local/.bin/hornet/update-weather b/local/.bin/hornet/update-weather
index fad6ff7..fb8afca 100755
--- a/local/.bin/hornet/update-weather
+++ b/local/.bin/hornet/update-weather
@@ -2,5 +2,6 @@
set -eu
set -o pipefail
-weather >~/.cache/weather.new
+echo "updating weather..."
+"$(dirname "$0")"/weather >~/.cache/weather.new
mv ~/.cache/weather.new ~/.cache/weather
diff --git a/packages.hornet b/packages.hornet
index f87a003..93039c7 100644
--- a/packages.hornet
+++ b/packages.hornet
@@ -1,7 +1,6 @@
alacritty
bash
crawl
-cron
fortune-mod
gdb
git
diff --git a/packages.mz-doy1 b/packages.mz-doy1
index 4b5e14b..a9ef767 100644
--- a/packages.mz-doy1
+++ b/packages.mz-doy1
@@ -1,6 +1,5 @@
alacritty
bash
-cron
fortune-mod
gdb
git