helm/os/arch/.config/panel/lemons/updates

24 lines
497 B
Plaintext
Raw Normal View History

#!/usr/bin/env dash
2016-10-19 07:56:37 -07:00
2016-11-06 16:40:02 -08:00
. $(dirname $0)/../panel-config
updtmp=/tmp/update-count
touch "$updtmp"
num=$({ checkupdates; cower -u; } | wc -l)
if [ "$num" -gt 0 ]
2016-11-06 16:40:02 -08:00
then
lastnum=$(<$updtmp)
if [ "$num" -ne "${lastnum:-0}" ]; then
echo "$num" > "$updtmp"
if [ "$num" -gt "${lastnum:-0}" ]; then
notify-send "$num new updates available"
fi
fi
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
# vim:set ft=sh: