#!/usr/bin/env bash
BAR_ICON=""
ICON=/usr/share/icons/gnome/32x32/apps/system-software-update.png
while true; do
count=$(checkupdates | wc -l)
if hash notify-send &>/dev/null; then
if [[ $count > 50 ]]; then
notify-send -u critical -i $ICON \
"You really need to update soon!!" "$count New package updates"
elif [[ $count > 25 ]]; then
notify-send -u normal -i $ICON \
"You should update soon" "$count New package updates"
elif [[ $count > 2 ]]; then
notify-send -u low -i $ICON \
"$count New package updates"
fi
while [[ $count > 0 ]]; do
if [[ $count == 1 ]]; then
echo "$count Update"
elif [[ $count > 1 ]]; then
echo "$count Updates"
sleep 8
done
while [[ $count == 0 ]]; do
echo $BAR_ICON
sleep 1200