integrated package information in bar.sh. Easier caching same process

This commit is contained in:
madmaurice 2015-06-19 03:34:48 +02:00
parent 64a5a05f42
commit 85abd161a2
2 changed files with 29 additions and 28 deletions

View file

@ -131,8 +131,36 @@ clock() {
} }
updates() { updates() {
pac_updates() {
checkupdates | wc -l
}
aur_updates() {
yaourt -Quaq | wc -l
}
useless_packages() {
pacman -Qtdq | wc -l
}
while true; do 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; echo updates "$icon_updates $updates" > $FIFO;
sleep 20 sleep 20
done done

View file

@ -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"