2018-02-05 21:31:56 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
BAR_ICON=""
|
|
|
|
ICON=/usr/share/icons/gnome/32x32/apps/system-software-update.png
|
|
|
|
|
|
|
|
while true; do
|
2018-02-07 19:38:43 -06:00
|
|
|
updates=$(checkupdates | wc -l)
|
2018-02-05 21:31:56 -06:00
|
|
|
if hash notify-send &>/dev/null; then
|
|
|
|
if [[ $updates -gt 50 ]]; then
|
|
|
|
notify-send -u critical -i $ICON \
|
|
|
|
"You really need to update soon!!" "$updates New package updates"
|
|
|
|
elif [[ $updates -gt 25 ]]; then
|
|
|
|
notify-send -u normal -i $ICON \
|
|
|
|
"You should update soon" "$updates New package updates"
|
|
|
|
elif [[ $updates -gt 2 ]]; then
|
2018-02-07 19:38:43 -06:00
|
|
|
notify-send -u low -i $ICON "$updates New package updates"
|
2018-02-05 21:31:56 -06:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
while [[ $updates -gt 0 ]]; do
|
|
|
|
if [[ $updates -eq 1 ]]; then
|
2018-02-07 19:38:43 -06:00
|
|
|
echo "$updates Update"
|
2018-02-05 21:31:56 -06:00
|
|
|
elif [[ $updates -gt 1 ]]; then
|
|
|
|
echo "$updates Updates"
|
|
|
|
fi
|
|
|
|
sleep 8
|
2018-02-07 19:38:43 -06:00
|
|
|
updates=$(checkupdates | wc -l)
|
2018-02-05 21:31:56 -06:00
|
|
|
done
|
|
|
|
|
2018-02-07 19:38:43 -06:00
|
|
|
while [[ $updates -eq 0 ]]; do
|
2018-02-05 21:31:56 -06:00
|
|
|
echo $BAR_ICON
|
2018-05-08 02:34:04 -05:00
|
|
|
sleep 1600
|
2018-02-07 19:38:43 -06:00
|
|
|
updates=$(checkupdates | wc -l)
|
2018-02-05 21:31:56 -06:00
|
|
|
done
|
|
|
|
done
|