SOLVED Re: how to start a kde application via shell script

Sascha Güthling guethling at googlemail.com
Fri May 22 12:29:01 UTC 2009


On Thu, May 21, 2009 at 8:59 PM, Bruce Marshall <bmarsh at bmarsh.com> wrote:
> On Thursday 21 May 2009, Antonio Augusto (Mancha) wrote:
>> One of the reasons that it doesn't work from cron is that the cron
>> process doesn't have an X session associated with it.
>> You can try puting the following before calling the kde application:
>> export DISPLAY=0:0
>
> I recently got a similar command to work by using the display statement right
> in the cron line:
>
> */10 * * * * DISPLAY=:0.0 /usr/local/bin/keepxfd2
>
> The above runs a script I wrote.

I tried both, I put 'export DISPLAY=0:0' and 'export DISPLAY=:0.0' in
my script before calling the KDE app, both didn't work. I got errors
saying "/usr/bin/bmix bad variable"

Changing my the crontab didn't help either.

But that told me to try piping the application start through export
DISPLAY=0:0 and that worked.
My script now looks as follows:
#!/bin/sh
/usr/bin/kmix | export DISPLAY=0:0

It works great.

Thanks for pushing me in the right direction. I appreciate it.

On Thu, May 21, 2009 at 9:02 PM, Alan Dacey Sr. <Grokit at ajinfosearch.com> wrote:
> Just to be clear, did you make a script called 'cron' or are you using cron
> to start a script?
>
> Alan

No, the script is not called 'cron', I'm using cron to start the
script. Sorry for the confusion.

Cheers
Sascha




More information about the kubuntu-users mailing list