From e2add462c0d66120867cdb7181a0d9c413f3e4c1 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Tue, 6 Feb 2024 20:44:09 +0000 Subject: Initial commit of Eww config --- .config/eww/scripts/arch-updates.sh | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 .config/eww/scripts/arch-updates.sh (limited to '.config/eww/scripts/arch-updates.sh') diff --git a/.config/eww/scripts/arch-updates.sh b/.config/eww/scripts/arch-updates.sh new file mode 100755 index 0000000..62bfe4a --- /dev/null +++ b/.config/eww/scripts/arch-updates.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +function CheckUpdates() { +updates="$(checkupdates;paru -Qum)" +arch="$(checkupdates | wc -l)" +aur="$(paru -Qum | wc -l)" +number=$((arch+aur)) + +if [ "$number" -gt 0 ]; then + text=" $number" +else + text="" +fi + +echo "$text" +} + +function RefreshUpdates() { + value="$(CheckUpdates)" + eww update arch-updates="$value" +} + +function Update() { + foot 'paru' + RefreshUpdates +} + +case "$1" in + Refresh) + RefreshUpdates + exit 0 + ;; + Update) + Update + exit 0 + ;; + *) + CheckUpdates + exit 0 +esac -- cgit v1.2.3