summaryrefslogtreecommitdiff
path: root/.scripts/checkupdates
blob: 5a9597466f1d57dce747aa36280eacff09c974ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env sh
set -e

updates=$(pacman -Qu | sed '/\[ignored\]$/d')

case $BLOCK_BUTTON in
  1) ;&  # fallthrough
  3) if [ -n "${updates}" ]; then
       notify-send -t $((1000 * 20)) "Available updates" "$updates"
     else
       notify-send "Available updates" "No available updates"
     fi;;
esac

[ -n "$updates" ] && echo $(echo "${updates}" | wc -l) || exit 0