Posts: 26
tuto
Joined: 07 Aug 2016
#1
Hi antixers..!

I am using AntiX-13.2 on a desktop PC, with space-icewm desktop and with the following enables services at boot:

Image

Image

I am trying run a bash script that use yad from user's crontab (using gnome-schedule), but no run. I did a test:

Code: Select all

export Display=:0.0 ; sleep 1 & /usr/bin/yad --text="Is a test on gnome-schedule function" --no-buttons --skip-taskbar --undecorated --timeout="5" 2>~/.cron.log
and in ~/.cron.log file:

Code: Select all

(yad:7054): Gtk-WARNING **: cannot open display:
From a search on the internet, I add the line to ~/.bashrc file:

Code: Select all

export Display=:0.0
and

Code: Select all

export $HOME/.XAuthority
but still the same.

I known that cron/gnome-schedule works because the ~/.cron.log file is generated.

The output of id command:

Code: Select all

tesistas@Tesistas:~
$ id
uid=1000(tesistas) gid=1000(tesistas) groups=1000(tesistas),7(lp),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),102(crontab),103(fuse),109(netdev),110(mlocate),1001(storage)
I hope you can help me.
Last edited by tuto on 25 Aug 2016, 02:29, edited 1 time in total.
Posts: 64
reverseDog
Joined: 13 Jul 2016
#2
Hasn't the exact problem already been solved in another thread of yours:
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"antix.freeforu ms.org/viewtopic.php?f=16&t=6547"
linktext was:"antix.freeforu ms.org/viewtopic.php?f=16&t=6547"
====================================
__{{emoticon}}__

Add the command export Display=:0.0 either to your crontab or to your script. Settings in ~/.bashrc won't work with cron.
Posts: 26
tuto
Joined: 07 Aug 2016
#3
Hi reverseDog..

Thanks by replay.
reverseDog wrote:Hasn't the exact problem already been solved in another thread of yours: is solved certainly... the crontab work.

But is time the thread is that yad from crontab not working although I added the variable
Display
to crontab and at line:

Image

In ~/.cron.log file continues to show:

Code: Select all

(yad:22553): Gtk-WARNING **: cannot open display:
.
Posts: 64
reverseDog
Joined: 13 Jul 2016
#4
Yeah, you're right. I can confirm that it doesn't work this way.

I got it running though after omitting the word"export". So let the line in your crontab start like

Code: Select all

* * * * * DISPLAY=:0.0 && sleep 1 && /usr/bin/yad ...
Posts: 26
tuto
Joined: 07 Aug 2016
#5
I added to crontab your suggestion and neither work.
Well I remove the line about to XAuthority and Display variable from ~/.bashrc file. AntiX already provided.

But I add this:

Image

and work fine.

Image

I found it in
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"https://help.ubuntu.com/community/CronHowto"
linktext was:"https://help.ubuntu.com/community/CronHowto"
====================================


Very... very thanks for your help. __{{emoticon}}__

And.. sorry for my English use. It is not my native language and I am learning __{{emoticon}}__ __{{emoticon}}__