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

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

 



I get an error when trying to start this script:

./gaim-start.sh
./gaim-start.sh: line 5: script-file=~/gaim-start.sh: No such file or directory
./gaim-start.sh: line 20: $script: ambiguous redirect

I tried to edit line 5 and change "script-file" to "$script-file" and
that also didn't work so I tried changing it to "$script" and it still
doesn't work...

I don't know enough bash to troubleshoot it.

Thank you for your feedback and help Mikkel.

Valent.


On 7/18/07, Mikkel L. Ellertson <mikkel@xxxxxxxxxxxxxxxx> wrote:
Valent Turkovic wrote:
> On 7/17/07, Mikkel L. Ellertson <mikkel@xxxxxxxxxxxxxxxx> 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!


--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list




--
http://kernelreloaded.blog385.com/
linux, blog, anime, spirituality, windsurf, wireless
registered as user #367004 with the Linux Counter, http://counter.li.org.
ICQ: 2125241
Skype: valent.turkovic


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux