dotfiles/bin/last-update

16 lines
395 B
Plaintext
Raw Permalink Normal View History

2023-07-11 10:30:43 -04:00
#!/bin/sh
num=$(checkupdates | wc -l) && [ "$num" -gt 0 ]
last_pkg_updates=$(grep 'pacman -Suuy' /var/log/pacman.log | tail -1 | tr -d '[' | cut -f 1 -d 'T')
case $1 in
"--notification")
2023-08-14 19:28:08 -04:00
dunstify -a "Updates" \
2023-07-11 10:30:43 -04:00
-r 100 \
2023-08-14 19:28:08 -04:00
"Updates" \
"$num updates available\nLast update: $last_pkg_updates ($(date +'%Y-%m-%d'))"
2023-07-11 10:30:43 -04:00
;;
esac
#echo "Last update: $last_pkg_updates ($(date +'%Y-%m-%d'))"