diff options
author | Aaditya Dhruv <[email protected]> | 2025-06-06 11:16:42 -0500 |
---|---|---|
committer | Aaditya Dhruv <[email protected]> | 2025-06-06 11:17:00 -0500 |
commit | 5fcb99d7c16029ee0495a437a7bbe7b003dda023 (patch) | |
tree | c4074843eaf86869d5902be30a0c5068c3740dd2 /src/config/files/polybar/scripts/updates.sh | |
parent | 97f21912d5f087dfa15cdba7de04e500ea08743a (diff) |
Cleanup configs
Diffstat (limited to 'src/config/files/polybar/scripts/updates.sh')
-rwxr-xr-x | src/config/files/polybar/scripts/updates.sh | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/config/files/polybar/scripts/updates.sh b/src/config/files/polybar/scripts/updates.sh deleted file mode 100755 index 70edf26..0000000 --- a/src/config/files/polybar/scripts/updates.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -NOTIFY_ICON=/usr/share/icons/Papirus/32x32/apps/system-software-update.svg - -get_total_updates() { UPDATES=$(checkupdates 2>/dev/null | wc -l); } - -while true; do - get_total_updates - - # notify user of updates - if hash notify-send &>/dev/null; then - if (( UPDATES > 50 )); then - notify-send -u critical -i $NOTIFY_ICON \ - "You really need to update!!" "$UPDATES New packages" - elif (( UPDATES > 25 )); then - notify-send -u normal -i $NOTIFY_ICON \ - "You should update soon" "$UPDATES New packages" - elif (( UPDATES > 2 )); then - notify-send -u low -i $NOTIFY_ICON \ - "$UPDATES New packages" - fi - fi - - # when there are updates available - # every 10 seconds another check for updates is done - while (( UPDATES > 0 )); do - if (( UPDATES == 1 )); then - echo "$UPDATES" - elif (( UPDATES > 1 )); then - echo "$UPDATES" - else - echo "None" - fi - sleep 10 - get_total_updates - done - - # when no updates are available, use a longer loop, this saves on CPU - # and network uptime, only checking once every 30 min for new updates - while (( UPDATES == 0 )); do - echo "None" - sleep 1800 - get_total_updates - done -done |