commit 4a30b0b1540ce6aa649ad3841ae4a7fa8b471e59 Author: Jonathan Wyss Date: Mon Aug 25 22:31:15 2025 +0200 init diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f2d050a --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +build: + tar cf update-notifier.tar update-notifier update-notifier.service update-notifier.timer diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..b4ed88d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,16 @@ +pkgname=update-notifier +pkgver=1.0.2 +pkgrel=3 +pkgdesc="notifies when updates are available via checkupdates" +arch=('x86_64') +depends=('pacman-contrib') +url='' +license=() +source=(${pkgname}.tar) +package() { + install -D "${srcdir}/${pkgname}" "$pkgdir/usr/bin/update-notifier" + install -D "${pkgname}.service" "${pkgdir}/usr/lib/systemd/user/${pkgname}.service" + install -D "${pkgname}.timer" "${pkgdir}/usr/lib/systemd/user/${pkgname}.timer" +} + +sha256sums=('b663e014d5b3baa122e8e91a6eaf781f11e5cb09b83965c2e325d6939d061fc7') diff --git a/update-notifier b/update-notifier new file mode 100755 index 0000000..9deb454 --- /dev/null +++ b/update-notifier @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +#export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-unix:path=/run/user/${UID}/bus}" +#export DISPLAY=:0 +n=$(checkupdates | wc -l) +if [ "$n" != "0" ]; then + notify-send "System update" "$n updates available." +fi +notify-send "hallo" diff --git a/update-notifier.service b/update-notifier.service new file mode 100644 index 0000000..f8a4205 --- /dev/null +++ b/update-notifier.service @@ -0,0 +1,6 @@ +[Unit] +Description=Check for updates using checkupdates + +[Service] +Type=simple +ExecStart=/usr/bin/update-notifier diff --git a/update-notifier.timer b/update-notifier.timer new file mode 100644 index 0000000..e061ce5 --- /dev/null +++ b/update-notifier.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Runs update-notifier periodically + +[Timer] +OnBootSec=5min +OnUnitActiveSec=3h +Unit=update-notifier.Service + +[Install] +WantedBy=timers.target