28 lines
356 B
Bash
28 lines
356 B
Bash
|
#!/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"
|