From 6e4a15d79352ca2707a3b0d81d158228a7d14704 Mon Sep 17 00:00:00 2001 From: 0scar Date: Thu, 3 Jun 2021 23:33:31 +0200 Subject: Add/move statusbar scripts --- .local/bin/statusbar/checkupdates | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 .local/bin/statusbar/checkupdates (limited to '.local/bin/statusbar/checkupdates') diff --git a/.local/bin/statusbar/checkupdates b/.local/bin/statusbar/checkupdates new file mode 100755 index 0000000..5a95974 --- /dev/null +++ b/.local/bin/statusbar/checkupdates @@ -0,0 +1,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 -- cgit v1.3