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
|
|
|
|
|
2018-05-12 13:00:19 -05:00
|
|
|
total() { UPD=$(checkupdates | wc -l) ;}
|
|
|
|
|
2018-02-05 21:31:56 -06:00
|
|
|
while true; do
|
2018-05-12 13:00:19 -05:00
|
|
|
total
|
2018-02-05 21:31:56 -06:00
|
|
|
if hash notify-send &>/dev/null; then
|
2018-05-18 22:36:34 -05:00
|
|
|
if (( $UPD > 50 )); then
|
2018-05-12 13:00:19 -05:00
|
|
|
notify-send -u critical -i $ICON "You really need to update!!" "$UPD New packages"
|
2018-05-18 22:36:34 -05:00
|
|
|
elif (( $UPD > 25 )); then
|
2018-05-12 13:00:19 -05:00
|
|
|
notify-send -u normal -i $ICON "You should update soon" "$UPD New packages"
|
2018-05-18 22:36:34 -05:00
|
|
|
elif (( $UPD > 2 )); then
|
2018-05-12 13:00:19 -05:00
|
|
|
notify-send -u low -i $ICON "$UPD New packages"
|
2018-02-05 21:31:56 -06:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2018-05-18 22:36:34 -05:00
|
|
|
while (( $UPD > 0 )); do
|
|
|
|
if (( $UPD == 1 )); then
|
2018-05-12 13:00:19 -05:00
|
|
|
echo "$UPD Update"
|
2018-05-18 22:36:34 -05:00
|
|
|
elif (( $UPD > 1 )); then
|
2018-05-12 13:00:19 -05:00
|
|
|
echo "$UPD Updates"
|
2018-02-05 21:31:56 -06:00
|
|
|
fi
|
2018-05-12 13:00:19 -05:00
|
|
|
sleep 10
|
|
|
|
total
|
2018-02-05 21:31:56 -06:00
|
|
|
done
|
|
|
|
|
2018-05-18 22:36:34 -05:00
|
|
|
while (( $UPD == 0 )); do
|
2018-02-05 21:31:56 -06:00
|
|
|
echo $BAR_ICON
|
2018-05-12 13:00:19 -05:00
|
|
|
sleep 1800
|
|
|
|
total
|
2018-02-05 21:31:56 -06:00
|
|
|
done
|
|
|
|
done
|