Created
June 2, 2020 22:13
-
-
Save QuietMisdreavus/c97d47cc293259339c3dc93383e46685 to your computer and use it in GitHub Desktop.
script and systemd unit/timer to notify me about arch system updates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=System update checker | |
[Service] | |
Type=oneshot | |
ExecStart=%h/bin/notify-updates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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