2016-11-04 17:50:03 -07:00
|
|
|
#!/usr/bin/env dash
|
2016-10-19 07:56:37 -07:00
|
|
|
|
2016-11-06 16:40:02 -08:00
|
|
|
. $(dirname $0)/../panel-config
|
|
|
|
|
2016-12-24 13:21:01 -08:00
|
|
|
updtmp=/tmp/update-count
|
|
|
|
touch "$updtmp"
|
|
|
|
|
2016-11-20 17:41:00 -08:00
|
|
|
num=$({ checkupdates; cower -u; } | wc -l)
|
2016-12-25 21:28:53 -08:00
|
|
|
if [ "$num" -gt 0 ]; then
|
|
|
|
lastnum=$(cat $updtmp)
|
2016-12-24 13:21:01 -08:00
|
|
|
if [ "$num" -ne "${lastnum:-0}" ]; then
|
|
|
|
echo "$num" > "$updtmp"
|
|
|
|
if [ "$num" -gt "${lastnum:-0}" ]; then
|
2016-12-25 21:28:53 -08:00
|
|
|
notify-send "$(( $num - $lastnum )) new update(s) available"
|
|
|
|
aplay -N -q /usr/share/sounds/ding.wav
|
2016-12-24 13:21:01 -08:00
|
|
|
fi
|
|
|
|
fi
|
2017-01-03 00:49:10 -08:00
|
|
|
echo "U%{F${COLOR_2}}$ICON_UPD $num%{F-}"
|
2016-11-06 16:40:02 -08:00
|
|
|
else
|
|
|
|
echo "U%{F${COLOR_DIM}}$ICON_UPD%{F-}"
|
|
|
|
fi
|
2016-11-20 17:41:00 -08:00
|
|
|
|
|
|
|
# vim:set ft=sh:
|