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
|
|
|
|
echo "$pac %{F#5b5b5b}%{F-} $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
|
|
|
|
echo "%{F#5b5b5b}%{F-}"
|
2017-04-26 15:52:37 -07:00
|
|
|
fi
|