aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--newsboat/systemd/user/reload-newsboat.service8
-rw-r--r--newsboat/systemd/user/reload-newsboat.timer9
3 files changed, 23 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 6e30647e..27832c36 100644
--- a/Makefile
+++ b/Makefile
@@ -495,6 +495,12 @@ install-ncmcpp: install-mpd
install-newsboat:
mkdir -p -- $(XDG_CONFIG_HOME)/newsboat $(XDG_DATA_HOME)/newsboat
cp -p -- newsboat/config $(XDG_CONFIG_HOME)/newsboat
+ -command -v systemctl >/dev/null 2>&1 \
+ && mkdir -p -- $(XDG_CONFIG_HOME)/systemd/user \
+ && cp -p -- newsboat/systemd/user/* $(XDG_CONFIG_HOME)/systemd/user \
+ && systemctl --user daemon-reload \
+ && systemctl --user start reload-newsboat.timer \
+ && systemctl --user enable reload-newsboat.timer
install-mysql:
cp -p -- mysql/my.cnf $(HOME)/.my.cnf
diff --git a/newsboat/systemd/user/reload-newsboat.service b/newsboat/systemd/user/reload-newsboat.service
new file mode 100644
index 00000000..24e4117c
--- /dev/null
+++ b/newsboat/systemd/user/reload-newsboat.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=fetch new Newsboat articles
+OnFailure=notify-email@%n
+After=tor.service
+ConditionPathExists=!%h/.local/share/newsboat/cache.db.lock
+
+[Service]
+ExecStart=newsboat -x reload
diff --git a/newsboat/systemd/user/reload-newsboat.timer b/newsboat/systemd/user/reload-newsboat.timer
new file mode 100644
index 00000000..83c7ff31
--- /dev/null
+++ b/newsboat/systemd/user/reload-newsboat.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=fetch new Newsboat articles
+
+[Timer]
+OnBootSec=5m
+OnUnitActiveSec=5m
+
+[Install]
+WantedBy=timers.target