2017-04-29 20:18:03 -07:00
|
|
|
#!/usr/bin/env bash
|
2017-04-26 15:52:37 -07:00
|
|
|
pac=$(checkupdates | wc -l)
|
|
|
|
aur=$(cower -u | wc -l)
|
|
|
|
|
2017-05-11 00:32:02 -07:00
|
|
|
last=$(</tmp/polybar-updates)
|
2017-04-26 15:52:37 -07:00
|
|
|
check=$((pac + aur))
|
|
|
|
if [[ "$check" != "0" ]]; then
|
2017-10-07 08:38:01 -07:00
|
|
|
echo "%{F#e5e8e6}%{F-} $pac,$aur"
|
2017-05-11 00:32:02 -07:00
|
|
|
if [[ $last != "$pac$aur" ]]; then
|
|
|
|
notify-send "$((pac+aur)) updates available"
|
|
|
|
aplay -N -q ~/.config/polybar/sounds/robni7-news-ting.wav
|
|
|
|
echo "$pac$aur" >/tmp/polybar-updates
|
|
|
|
fi
|
2017-04-27 22:39:18 -07:00
|
|
|
else
|
2017-10-07 08:38:01 -07:00
|
|
|
echo "%{F#22e5e8e6}%{F-} "
|
2017-04-26 15:52:37 -07:00
|
|
|
fi
|