helm/os/+arch/.config/polybar/modules/updates

17 lines
449 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
2017-04-26 15:52:37 -07:00
pac=$(checkupdates | wc -l)
aur=$(cower -u | wc -l)
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"
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
else
2017-10-07 08:38:01 -07:00
echo "%{F#22e5e8e6}%{F-} "
2017-04-26 15:52:37 -07:00
fi