diff options
Diffstat (limited to 'polybar/scripts/check-all-updates.sh')
| -rwxr-xr-x | polybar/scripts/check-all-updates.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/polybar/scripts/check-all-updates.sh b/polybar/scripts/check-all-updates.sh new file mode 100755 index 0000000..dda6212 --- /dev/null +++ b/polybar/scripts/check-all-updates.sh @@ -0,0 +1,21 @@ +#!/bin/bash +#source https://github.com/x70b1/polybar-scripts + +# Count official repo updates +if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then + updates_arch=0 +fi + +# Count AUR updates using yay +if ! updates_aur=$(yay -Qu --quiet 2> /dev/null | wc -l ); then + updates_aur=0 +fi + +# Total updates +updates=$(("$updates_arch" + "$updates_aur")) + +if [ "$updates" -gt 0 ]; then + echo " $updates" +else + echo "0" +fi |
