support paru in checkUpdates & clarify polling interval is in ms (#601)

* feat(scripts): support `paru` for checking package updates

* fix(config): clarify polling interval is in ms

---------

Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
Amaan Qureshi
2024-12-24 05:53:30 -05:00
committed by GitHub
parent e7d9235bf5
commit c87a6ca251
2 changed files with 8 additions and 3 deletions

View File

@@ -3,14 +3,19 @@
check_arch_updates() {
official_updates=0
aur_updates=0
if command -v paru &> /dev/null; then
aur_helper="paru"
else
aur_helper="yay"
fi
if [ "$1" = "-y" ]; then
aur_updates=$(yay -Qum 2>/dev/null | wc -l)
aur_updates=$($aur_helper -Qum 2>/dev/null | wc -l)
elif [ "$1" = "-p" ]; then
official_updates=$(checkupdates 2>/dev/null | wc -l)
else
official_updates=$(checkupdates 2>/dev/null | wc -l)
aur_updates=$(yay -Qum 2>/dev/null | wc -l)
aur_updates=$($aur_helper -Qum 2>/dev/null | wc -l)
fi
total_updates=$((official_updates + aur_updates))