aboutsummaryrefslogtreecommitdiff
path: root/dot-config/yambar/scripts/pacman-notify
diff options
context:
space:
mode:
authorBlake Romero <blake@blkrom.com>2024-12-16 00:35:48 +0000
committerBlake Romero <blake@blkrom.com>2024-12-16 00:35:48 +0000
commit491268c0160ece4b00148f1bb0f4cef22a5d050c (patch)
tree15ae9dc97adf109b93e58870bf49fcf904fbf82a /dot-config/yambar/scripts/pacman-notify
parentc13e166e9f9c67af7d3c2a411275b99ae1ba735a (diff)
Add pacman module & scripts for yambar
Diffstat (limited to 'dot-config/yambar/scripts/pacman-notify')
-rwxr-xr-xdot-config/yambar/scripts/pacman-notify18
1 files changed, 18 insertions, 0 deletions
diff --git a/dot-config/yambar/scripts/pacman-notify b/dot-config/yambar/scripts/pacman-notify
new file mode 100755
index 0000000..a9ce535
--- /dev/null
+++ b/dot-config/yambar/scripts/pacman-notify
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Get package count
+count=$(wc -l < ~/.cache/updates)
+
+# Generate message
+if [ "$count" = 0 ]; then
+ msg="No updates available"
+else
+ msg="$count Available Update"
+ (("$count" > 1 )) && msg+="s"
+fi
+
+# Notify
+notify-send \
+ -i package-x-generic \
+ -h string:x-canonical-private-synchronous:updates \
+ "$msg" "$(cut -f1 -d' ' ~/.cache/updates)"