From 3c176706d3a3b410b5294daba59a7dce03a92c96 Mon Sep 17 00:00:00 2001 From: Daniele Fucini Date: Sat, 23 Mar 2024 11:42:22 +0100 Subject: [PATCH] Add systemd timer --- PKGBUILD | 2 ++ update-notify.service | 7 +++++++ update-notify.timer | 10 ++++++++++ 3 files changed, 19 insertions(+) create mode 100644 update-notify.service create mode 100644 update-notify.timer diff --git a/PKGBUILD b/PKGBUILD index 9be2bbf..60ad614 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -32,4 +32,6 @@ package() { cd ${srcdir}/${_pkgname} install -Dm755 ${_pkgname} ${pkgdir}/usr/bin/${_pkgname} + install -Dm644 ${_pkgname}.service ${pkgdir}/usr/lib/systemd/user/${_pkgname}.service + install -Dm644 ${_pkgname}.timer ${pkgdir}/usr/lib/systemd/user/${_pkgname}.timer } diff --git a/update-notify.service b/update-notify.service new file mode 100644 index 0000000..44a9019 --- /dev/null +++ b/update-notify.service @@ -0,0 +1,7 @@ +[Unit] +Description=Notify if updates are available + +[Service] +ExecStart=/usr/bin/update-notify 30 +Type=simple +Restart=no diff --git a/update-notify.timer b/update-notify.timer new file mode 100644 index 0000000..43b8989 --- /dev/null +++ b/update-notify.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Run update-notify every 6 hours + +[Timer] +OnBootSec=5min +OnUnitActiveSec=6h +Persistent=true + +[Install] +WantedBy=timers.target