diff --git a/scripts/bar.sh b/scripts/bar.sh index 159a969..315e0f6 100755 --- a/scripts/bar.sh +++ b/scripts/bar.sh @@ -131,8 +131,36 @@ clock() { } updates() { + pac_updates() { + checkupdates | wc -l + } + + aur_updates() { + yaourt -Quaq | wc -l + } + + useless_packages() { + pacman -Qtdq | wc -l + } + while true; do - updates=$(./pkginfo.sh) + internet=$(wicd-cli --status | grep Connected) + if [ -z "internet" ]; then + if [ -z "$pac" ]; then + pac=? + fi + if [ -z "$aur" ]; then + aur=? + fi + else + pac=$(pac_updates) + aur=$(aur_updates) + fi + + useless=$(useless_packages) + + updates="$pac+$aur-$useless" + echo updates "$icon_updates $updates" > $FIFO; sleep 20 done diff --git a/scripts/pkginfo.sh b/scripts/pkginfo.sh deleted file mode 100755 index 5c77340..0000000 --- a/scripts/pkginfo.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -internet=$(wicd-cli --status | grep Connected) - -pac_updates() { - checkupdates | wc -l -} - -aur_updates() { - yaourt -Quaq | wc -l -} - -useless_packages() { - pacman -Qtdq | wc -l -} - -if [ -z "$internet" ]; then - pac=? - aur=? -else - pac=$(pac_updates) - aur=$(aur_updates) -fi - -useless=$(useless_packages) - -echo "$pac+$aur-$useless"