16 lines
395 B
Bash
Executable File
16 lines
395 B
Bash
Executable File
#!/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")
|
|
dunstify -a "Updates" \
|
|
-r 100 \
|
|
"Updates" \
|
|
"$num updates available\nLast update: $last_pkg_updates ($(date +'%Y-%m-%d'))"
|
|
;;
|
|
esac
|
|
|
|
#echo "Last update: $last_pkg_updates ($(date +'%Y-%m-%d'))"
|