More infos about updates

This commit is contained in:
madmaurice 2015-06-08 18:25:12 +02:00
parent e2fc359cdf
commit 05a3e848a2
2 changed files with 30 additions and 3 deletions

View file

@ -83,8 +83,8 @@ clock() {
}
updates() {
info=$(./cmdcache.sh 20 checkupdates | wc -l)
echo -n "$icon_updates $info"
updates=$(./cmdcache.sh 20 ./pkginfo.sh)
echo -n "$icon_updates $updates"
}
run_handler() {
@ -102,5 +102,5 @@ run_handler() {
while true; do
echo "%{l} $(music) $(services) $(diskspace)%{r}$(updates) $(wifi) $(battery) $(clock) "
sleep 1
done | lemonbar -g 1366x15 -f "Terminus:size=8","Stlarch:size=6:style=regular" -B "#88000000" | run_handler
done | lemonbar -g 1366x15 -f "Stlarch:size=6:style=regular" -f "Terminus:size=8" -B "#88000000" | run_handler

27
scripts/pkginfo.sh Executable file
View file

@ -0,0 +1,27 @@
#!/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"