aboutsummaryrefslogtreecommitdiff
path: root/dot-config/yambar/scripts/pacman-notify
blob: 25ff146f87f01e9969ef0886b12cd42f3b99f8b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# Get package count
count=$(sed '/^$/d'  ~/.cache/updates | wc -l)

# Generate message
if [ "$count" = 0 ]; then
	msg="No updates available"
else
	msg="$count Available Update"
	(("$count" > 1 )) && msg+="s"
fi

# Notify
notify-send \
	-h string:x-canonical-private-synchronous:updates \
	"$msg" "$(cut -f1 -d' ' ~/.cache/updates | sed -z 's/\n/ /g')"