configfiles/scripts/pkginfo.sh

27 lines
356 B
Bash
Executable file

#!/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"