summaryrefslogblamecommitdiff
path: root/i3blocks-packages.sh
blob: f139e285170431f7465c00b19fc44dfbe278587e (plain) (tree)
1
2
3
4
5
6
7


         
                                      
                                                                                   
                                                                                                                        
           
#!/bin/sh
icon=󰏖

doas pkg update 2>/dev/null >/dev/null
count=$(pkg upgrade -n | sed -n 's/^Number of packages to be upgraded:\(.*\)/\1/p')
[ -n "$count" ] && [ "$count" -gt 0 ] && printf "%s%s" $icon $count && notify-send "$count package upgrade(s) available"
printf "\n"