I was going to use crontab call the following script:
#!/usr/bin/wish
frame .mv
pack .mv
canvas .mv.c
pack .mv.c
button .mv.c.b -text "Run Friday backup" -command exit
.mv.c create window 400 300 -window .mv.c.b
But when it runs I get the following error:
Application initialization failed: no display name and no $DISPLAY
environment
variable
Error in startup script: invalid command name "frame"
while executing
"frame .mv"
(file "/home/strycat/backupreminder line 3)
Any help would be appreciated.
Thanks,
-Tom
Your cron table entry could use the -display option to specify a
display. You have to make certain that whatever user cron is using has
the right to use the display.
i.e.
10 * * * * $HOME/myscript.tcl -display myworkstation:0:0 ...
in your cron table.
You may also need to do :
xhost +
after you log in under X (gnome, kde, whatever...) depending on your
security setup. You might also want to use a wrapper script that finds
out if you are logged in, so that other users don't get popup notices
that you should call your girlfriend/wife/mother etc.
Well, you should put something after the "+" sign. Read the man page for
xhost.
Amazing how folks will tell you to brace expr args because someone might
pass in [exec format c:\\] or some such, and then mention "by the way,
open your box up to every keyboard sniffer on the planet." ;-)
--
Darren New, San Diego CA USA (PST)
I am in geocentric orbit, supported by
a quantum photon exchange drive....
For the original poster: I'd assume that you're talking about your
home-computer where you are your only user, and your display is
always ":0.0".
To get it working, you need two variables:
set env(DISPLAY) :0.0
set env(XAUTHORITY) $env(HOME)/.Xauthority
after(!) that you add:
package require Tk
and make the script a tclsh-script (not wish!).
if you leave it as a wish-script, the env-setting are too late to
have any effect.
Thus, the script should start as follows:
--- snip start of script ---
#!/usr/bin/env tclsh
set env(DISPLAY) :0.0
set env(XAUTHORITY) $env(HOME)/.Xauthority
package require Tk
--- snip end of script-header. add your code below ---
The /usr/bin/env trick usually saves me from guessing your
tclsh-location. (There also exist other tricks to achieve
this effect)
Also remember to put it in your personal crontab rather than
the global /etc/crontab or otherwise it will not know your
Homedirectory. If your tclsh is not located in /usr/bin
(nor in /bin) you might need to specify its absolute path,
rather than rely on the /usr/bin/env-trick.
I luckly didn't have to mess with xhost, but I did have to have the
script set the some things.
Thanks again,
-Tom
Darren New <dn...@san.rr.com> wrote in message news:<ujK0c.10064$4o3....@twister.socal.rr.com>...