summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.config/polybar/extra/updates-pacman-aurhelper.sh4
-rwxr-xr-x.local/bin/aurignored16
2 files changed, 19 insertions, 1 deletions
diff --git a/.config/polybar/extra/updates-pacman-aurhelper.sh b/.config/polybar/extra/updates-pacman-aurhelper.sh
index a785cd7..83425f5 100755
--- a/.config/polybar/extra/updates-pacman-aurhelper.sh
+++ b/.config/polybar/extra/updates-pacman-aurhelper.sh
@@ -13,7 +13,9 @@ if ! updates_aur=$(paru -Qum 2> /dev/null | wc -l); then
updates_aur=0
fi
-updates=$((updates_arch + updates_aur))
+aur_ignored=$(aurignored | wc -l)
+
+updates=$((updates_arch + updates_aur - $aur_ignored))
if [ "$updates" -gt 0 ]; then
echo " $updates"
diff --git a/.local/bin/aurignored b/.local/bin/aurignored
new file mode 100755
index 0000000..2eaabd8
--- /dev/null
+++ b/.local/bin/aurignored
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Get list of ignored pkgs
+function ignored() {
+ pkgs="$(grep IgnorePkg /etc/pacman.conf | sed -e 's/IgnorePkg =//' -e 's/#.*//')"
+ grps="$(grep IgnoreGroup /etc/pacman.conf | sed -e 's/IgnoreGroup =//' -e 's/#.*//')"
+ [[ -n $grps ]] && pkgs="$pkgs $(pacman -Sgq $grps)"
+
+ echo -n "$pkgs" | tail -n -1
+}
+
+# Return only AUR pkgs
+for pkg in $(ignored)
+do
+ pacman -Si $pkg &>/dev/null || echo "$pkg"
+done