aboutsummaryrefslogtreecommitdiffstats
path: root/polybar/scripts/check-all-updates.sh
diff options
context:
space:
mode:
authorGravatar BanceDev 2026-02-21 14:54:14 -0500
committerGravatar BanceDev 2026-02-21 14:54:14 -0500
commitd9be77d6429d598f3ec7eead1620c33556b7c865 (patch)
treee5537c045d868e7a65147a69746ec173a217d327 /polybar/scripts/check-all-updates.sh
initial commit
Diffstat (limited to 'polybar/scripts/check-all-updates.sh')
-rwxr-xr-xpolybar/scripts/check-all-updates.sh21
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