A little more than a year ago I wrote a notifier app. (on Ubuntu 16.04.7) which played some audio with paplay and then put up a yad window with the text of the notification. This could be run either from command line or from cron. Recently I installed Ubuntu 20.04.3 and found that running from command line still works but running from cron doesn't. I have a bin directory below my home directory where the script (remind.sh) is kept. The pared down version of remind.sh is the following. Note that when I run from cron I get no audio indication the script has run but the trace.txt file gets updated and yad produces a window.
#!/bin/bash
# reminder script called from either
# 1. cron or
# 2. directly from shell to pop-up or
# 3. gidday.sh
# produces a 'yad' window with a picture and message in it.
/usr/bin/paplay /home/gary/sounds/marimba.ogg
# trace the run
d=`date`
echo "done -- "$d >> trace.txt
# now put out the window
#
#/usr/bin/yad --borders=50 --scroll --image=/home/gary/Pictures/shrunk-pictures/${ar[$t]} --title="${ar[$t]}" --text-align=center --mouse --width=800 --height=400 --text='<span font="20">'"$txt"'</span>' 2>/dev/null
Sorry, I should have provided the following in my original post. The line in crontab that fires off the remind1.sh script is:
36 13 30 aug * export DISPLAY=:0 && export MESSG="get movies from lib" && /home/gary/bin/remind1.sh
As I said before, this all ran perfectly fine in Ubuntu 16.04. And it still doesn't explain why the paplay command doesn't run but the (uncommented) yad command does.