Skip to content

Instantly share code, notes, and snippets.

@QuietMisdreavus
Created June 2, 2020 22:13
Show Gist options
  • Save QuietMisdreavus/c97d47cc293259339c3dc93383e46685 to your computer and use it in GitHub Desktop.
Save QuietMisdreavus/c97d47cc293259339c3dc93383e46685 to your computer and use it in GitHub Desktop.
script and systemd unit/timer to notify me about arch system updates
#!/usr/bin/bash
# vim: ft=bash
pacupdates=$(/usr/bin/checkupdates | wc -l)
if [ "$pacupdates" -gt 0 ] ; then
/usr/bin/notify-send "${pacupdates//[[:space:]]/} packages can be updated"
fi
if [ -x ~/.cargo/bin/qmaur ] ; then
aurupdates=$(~/.cargo/bin/qmaur checkupdates | wc -l)
if [ "$aurupdates" -gt 0 ] ; then
/usr/bin/notify-send "${aurupdates//[[:space:]]/} AUR packages can be updated"
fi
fi
[Unit]
Description=System update checker
[Service]
Type=oneshot
ExecStart=%h/bin/notify-updates
[Unit]
Description=Check for updates every day
[Timer]
OnCalendar=12:00
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment