os/arch (lemonbar+dunst): better email/update notifications + sound
This commit is contained in:
parent
978c57c6e1
commit
2a0149e61e
|
@ -36,11 +36,12 @@ color="${COLOR_FG}"
|
|||
case $num in
|
||||
[1-9]*)
|
||||
icon="$icon$num"
|
||||
lastnum=$(<$mailtmp)
|
||||
lastnum=$(cat "$mailtmp")
|
||||
if [[ $num != $lastnum ]]; then
|
||||
echo "$num" > "$mailtmp"
|
||||
if (( $num > $lastnum )); then
|
||||
notify-send "New messages" "You have $(( $num - $mailtmp )) new messages"
|
||||
notify-send "New messages" "You have $(( $num - $lastnum )) new messages"
|
||||
aplay -N -q /usr/share/sounds/ding.wav
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
|
|
@ -6,13 +6,13 @@ updtmp=/tmp/update-count
|
|||
touch "$updtmp"
|
||||
|
||||
num=$({ checkupdates; cower -u; } | wc -l)
|
||||
if [ "$num" -gt 0 ]
|
||||
then
|
||||
lastnum=$(<$updtmp)
|
||||
if [ "$num" -gt 0 ]; then
|
||||
lastnum=$(cat $updtmp)
|
||||
if [ "$num" -ne "${lastnum:-0}" ]; then
|
||||
echo "$num" > "$updtmp"
|
||||
if [ "$num" -gt "${lastnum:-0}" ]; then
|
||||
notify-send "$num new updates available"
|
||||
notify-send "$(( $num - $lastnum )) new update(s) available"
|
||||
aplay -N -q /usr/share/sounds/ding.wav
|
||||
fi
|
||||
fi
|
||||
echo "U%{F${COLOR_2}}$ICON_UPD$num%{F-}"
|
||||
|
|
Loading…
Reference in a new issue