aboutsummaryrefslogtreecommitdiff
path: root/dot-config/yambar/scripts/pacman-notify
blob: a9ce5353176c2f6916994894435c59f8902e7ac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)"