The crontab has 'minimal' environment.
It will not have the DISPLAY or XAUTHORITY environment set, and as such
would not have access to the X server.
You generally need as a minimum...
DISPLAY=0 and the users HOME
However that only works if the authorization is located in
".Xauthority" of the uses home.
If it isn't then a XAUTHORITY environment variable is needed to specify
the file location of the authorization 'cookies'.
For details see the manpage "xauth"
Alternative to 'xauth' access controlis to use xhost to allow any
localhost connection. However some clients hate this and 'turns off'
xhost access regardless of is the user wanted it or not. TCL and WISH
scripts is well known for this big-brother type of action.
See "xhost" manpage, also look at "Xsecurity"
Note xhost access is not recommended as it allows ANY user on the
localhost to connect to the display, not just the logged in 'owner'.
That however may be preferable for a system controlled 'kiosk' type
machine, where no actual user actually 'logs in' on the display.
For more information in access to X window Displays see my OLD
document...
http://www.ict.griffith.edu.au/anthony/info/X/Display.needs
Anthony Thyssen ( System Programmer ) <A.Th...@griffith.edu.au>
--------------------------------------------------------------------------
A priestly young person called Eric,
Whilst practising to be a cleric,
Misspelt his god's name,
'twas really a shame,
And thus ended Eric, the cleric.
--------------------------------------------------------------------------
Anthony's Castle http://www.ict.griffith.edu.au/anthony/