summaryrefslogtreecommitdiff
path: root/.local/bin/aurignored
diff options
context:
space:
mode:
authoradam <56338480+adastx@users.noreply.github.com>2022-10-09 15:52:47 +0200
committeradam <56338480+adastx@users.noreply.github.com>2022-10-09 15:52:47 +0200
commit2b14b00c0d72a2db3e9828c62d131f8cb41e3a95 (patch)
tree2ef9bd88deaed4a92c4aeb6699c07728b7f8f656 /.local/bin/aurignored
parente5ce39bca66f1b6827232d420ed041645ef65d9c (diff)
polybar: exclude ignored AUR pkgs from update count
Diffstat (limited to '.local/bin/aurignored')
-rwxr-xr-x.local/bin/aurignored16
1 files changed, 16 insertions, 0 deletions
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