diff --git a/scripts/bar.sh b/scripts/bar.sh index ccca271..c86e63b 100755 --- a/scripts/bar.sh +++ b/scripts/bar.sh @@ -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 diff --git a/scripts/pkginfo.sh b/scripts/pkginfo.sh new file mode 100755 index 0000000..e521be3 --- /dev/null +++ b/scripts/pkginfo.sh @@ -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"