From c4be0fe3c58fe07e235f624974b4f8102a17ecca Mon Sep 17 00:00:00 2001 From: 0scar Date: Wed, 21 Oct 2020 17:51:56 +0200 Subject: Add some neat scripts --- .scripts/checkupdates | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 .scripts/checkupdates (limited to '.scripts/checkupdates') 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 -- cgit v1.3