setting linux display for Cron

Y

Y.G.

Another question from me then. I am writing my Gtk-program and I want to
run it via a cronjob. I am already testing if I am logged in and so. Now
I want the cron to display the window on my own display. For the moment
I tried doing this using:

#!/usr/local/bin/perl -w

$ENV{DISPLAY} = ":0.0";
$ENV{XAUTHORITY} = "/myhome/.Xauthority";

use IO::Handle;
use Gtk2 '-init' ; # load the Gtk-Perl module
use Glib; # timeout...
use strict; # a good idea for all non-trivial Perl scripts

(And here follows my program)

When I run it from command line it works. When cron runs it I get an
e-mail which sais:

Gtk-WARNING **: cannot open display: at
perlpath/lib/site_perl/5.8.5/i686-linux/Gtk2.pm line 62.

Should I add a line which tells Gtk2 which displ;ay I am using?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top