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
|
case $num in
|
||||||
[1-9]*)
|
[1-9]*)
|
||||||
icon="$icon$num"
|
icon="$icon$num"
|
||||||
lastnum=$(<$mailtmp)
|
lastnum=$(cat "$mailtmp")
|
||||||
if [[ $num != $lastnum ]]; then
|
if [[ $num != $lastnum ]]; then
|
||||||
echo "$num" > "$mailtmp"
|
echo "$num" > "$mailtmp"
|
||||||
if (( $num > $lastnum )); then
|
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
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -6,13 +6,13 @@ updtmp=/tmp/update-count
|
||||||
touch "$updtmp"
|
touch "$updtmp"
|
||||||
|
|
||||||
num=$({ checkupdates; cower -u; } | wc -l)
|
num=$({ checkupdates; cower -u; } | wc -l)
|
||||||
if [ "$num" -gt 0 ]
|
if [ "$num" -gt 0 ]; then
|
||||||
then
|
lastnum=$(cat $updtmp)
|
||||||
lastnum=$(<$updtmp)
|
|
||||||
if [ "$num" -ne "${lastnum:-0}" ]; then
|
if [ "$num" -ne "${lastnum:-0}" ]; then
|
||||||
echo "$num" > "$updtmp"
|
echo "$num" > "$updtmp"
|
||||||
if [ "$num" -gt "${lastnum:-0}" ]; then
|
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
|
||||||
fi
|
fi
|
||||||
echo "U%{F${COLOR_2}}$ICON_UPD$num%{F-}"
|
echo "U%{F${COLOR_2}}$ICON_UPD$num%{F-}"
|
||||||
|
|
Loading…
Reference in a new issue