diff options
Diffstat (limited to '.scripts/checkupdates')
| -rwxr-xr-x | .scripts/checkupdates | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/.scripts/checkupdates b/.scripts/checkupdates new file mode 100755 index 0000000..380afd3 --- /dev/null +++ b/.scripts/checkupdates @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -e + +updates=$(pacman -Qu | sed '/\[ignored\]$/d') + +case $BLOCK_BUTTON in + 1) ;& # fallthrough + 3) if [ -n "${updates}" ]; then + notify-send "Available updates" "$updates" + else + notify-send "Available updates" "No available updates" + fi;; +esac + +[ -n "$updates" ] && echo $(echo "${updates}" | wc -l) || exit 0 |
