3

I'm trying to setup a simple bash script. I want to open the browser.

chromium-browser <url> works if I do it in the cli or in the bash script if I run the script by ./scrpt.

But if I put that script in crontab, which is what I really want I get. (chromum:xxxx) : Gtk-WARNING **: cannot open display:

I added export DISPLAY=:1 and now I get Client is not authrized to connect to the Server (chromum:xxxx) : Gtk-WARNING **: cannot open display 1

I'm not sure if the export line is helpful or needed, but I was it suggested else where. Using 0 gives an error about protocol. Also other browsers cause errors too, ill use whatever browser. I've had the same issue with x-www-browser

4
  • 1
    Where is your XServer? You can probably fix this with DISPLAY=:1 xhost + on the machine that it runs on. Whether that's a good idea is another question :) May 3, 2013 at 21:38
  • 1
    Please note that there is also Raspberry Pi. If you don't get an answer here, you can flag this question and ask for it to be migrated there. May 3, 2013 at 22:37
  • Why are you attempting to open a web browser from a cron job?
    – Dan D.
    May 3, 2013 at 23:47
  • My xserver is local to the rpi Its either 0 or 1. I knew someone would ask why, I get that its odd, but I want to generate regular occurrence of a script that I wrote for generating traffic.
    – wlraider70
    May 4, 2013 at 19:07

1 Answer 1

0

If the URL points to a web app that you manage, consider using AJAX to update the page contents, rather than cron.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .