#!/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')"