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

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