Code: Select all
#!/bin/bash
exec 3>&1 4>&2
trap 'exec 2>&4 1>&3' 0 1 2 3
exec 1>log.out 2>&1
echo "script started" > logFile
#export DISPLAY=:0.0
/usr/bin/yad --notification
echo "script ended" >> logFile
When I ran the script as user or as root it works.
When i add the script to cron as user or as root the icon is not shown.
In the logfile log.out I get the following error:
Code: Select all
Unable to init server: Could not connect: Connection refused
(yad:682): Gtk-WARNING **: 13:01:18.954: cannot open display:
Can anybody help me with this problem???