2018-05-03 20:23:53 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2019-01-26 19:28:04 +01:00
|
|
|
# Seems like the network is not up yet when this script is launched
|
|
|
|
# for the first time, causing an error. So wait a bit
|
|
|
|
sleep 5
|
2018-05-30 23:46:01 +02:00
|
|
|
updates_arch=$(/usr/bin/checkupdates | wc -l)
|
2018-05-03 20:23:53 +02:00
|
|
|
|
|
|
|
if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
|
|
|
|
updates_aur=0
|
|
|
|
fi
|
|
|
|
|
|
|
|
updates=$(("$updates_arch" + "$updates_aur"))
|
|
|
|
|
|
|
|
if [ "$updates" -gt 0 ]; then
|
2019-11-20 22:42:26 +01:00
|
|
|
echo "%{F#dd7777}%{F#ddd} $updates_arch | $updates_aur"
|
2018-05-03 20:23:53 +02:00
|
|
|
else
|
|
|
|
echo "%{F#77dd77}%{F#ddd} 0"
|
|
|
|
fi
|