add hostname to voice message

This commit is contained in:
ray 2020-02-17 16:33:11 +00:00
parent 5cb8d92b91
commit 4ac12ea156
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ _target_file="/tmp/pacman-update-count"
_notify_none=0 _notify_none=0
_error_code=0 _error_code=0
_show_help=0 _show_help=0
_hostname=$(hostname)
if ! [ -f "$_target_file" ] ; if ! [ -f "$_target_file" ] ;
then then
@ -43,9 +44,9 @@ if [ "$_updates_available" -gt 0 ] ; then
if [ "$_updates_available" -lt 2 ] ; then if [ "$_updates_available" -lt 2 ] ; then
_plural="" _plural=""
fi fi
echo "Attention please: Update required: $_updates_available package$_plural" | festival --tts echo "Attention please: Update required for $_hostname: $_updates_available package$_plural" | festival --tts
notify-send "Update Notifier" "Update required: $_updates_available package$_plural" notify-send "Update Notifier" "Update required: $_updates_available package$_plural"
elif [ "$_notify_none" -eq 1 ] ; then elif [ "$_notify_none" -eq 1 ] ; then
echo "Attention please: No package updates required" | festival --tts echo "Attention please: No package updates required for $_hostname" | festival --tts
notify-send -u low "Update Notifier" "No updates required" notify-send -u low "Update Notifier" "No updates required"
fi fi