27 lines
356 B
Bash
Executable file
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"
|