#!/bin/sh # Wait for connection source $(dirname $0)/../.env connect=$(ping -q -w 1 -c 1 8.8.8.8 &> /dev/null) if [ $? -eq 0 ]; then updates_arch=$(/usr/bin/checkupdates | wc -l) # a restricts to AUR packages updates_aur=$(yay -Qua | wc -l) updates=$(("$updates_arch" + "$updates_aur")) if [ "$updates" -gt 0 ]; then echo "%{F$MOCHA_MAUVE}%{F$MOCHA_TEXT} $updates_arch | $updates_aur" else echo "%{F$MOCHA_GREEN}%{F$MOCHA_TEXT} 0" fi else echo "%{F#77dd77}%{F#ddd} Offline" fi