Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
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 :) –  Rich Homolka May 3 '13 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. –  Oliver Salzburg May 3 '13 at 22:37
    
Why are you attempting to open a web browser from a cron job? –  Dan D. May 3 '13 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 '13 at 19:07

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.