[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: how to make cron run gaim under my X session?



Valent Turkovic wrote:
> On 7/17/07, Mikkel L. Ellertson <mikkel infinity-ltd com> wrote:
>> Valent Turkovic wrote:
>> > Hi, I use gnome-schedule as a gui for cron but I can't make it start
> 
> 
> Hi Mikkel,
> 
> I tried playing with at command and I can't make it start when I want to.
> 
> gaim | at now +1 minute
> - this starts gaim right away
> 
You are trying to start gain, and pipe the output from gaim into the
at command. This is not the way to use the at command.

> echo 'gaim'|at now + 1 minute
> - this does nothing
> 
Trying to do the same thing.

> making a script called "start" and giving it +x and then:
> at -f start now +1 minute
> - does nothing.
> 
Your script probably does not have the prroper settings for
XAUTHORITY and DISPLAY.

> I tried reading man and googling but I can't find an answer how to
> start gaim every day at 8:15 under my username "pero" that I log in.
> 
> Thank you in advance,
> Valent.
> 
> 
A quick, cheap, and dirty script to be run when you stat the GUI -
not tested.

================== cut ===============
#!/bin/bash
#
# A script to create a script to run GAIM at 8:15 am.
#
script-file=~/gaim-start.sh

if [ -z $XAUTHORITY ] ; then
	echo XAUTHORITY in not set!
	exit 1
fi

if [ -z $DISPLAY ] ; then
	echo DISPLAY is not set!
	exit 1
fi

echo \#\!/bin/bash > $script-file
echo XAUTHORITY=$XAUTHORITY >> $script-file
echo DISPLAY=$DISPLAY >> $script-file
echo gaim >> $script file

at -f $script-file 8:15 am

================== cut ===============

This script only runs gain once, but if you have it run when you do
a GUI login, and you log out every night, and back in every morning,
it should do the job. Otherwise, you could add a command to run this
script again at the end of the gaim-start.sh script. (echo
start-script.sh >> $script-file) But this will also try to start
gain when you are not logged in...

To do things properly, you should probably cancel the at job when
you log out...

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]