0

I have a simple script start_chromium.sh:

#!/bin/bash

DISPLAY=:0 chromium-browser --start-fullscreen --kiosk http://server:8080

When I do sudo crontab -e and add @reboot /home/pi/start_chromium.sh to the bottom, it seems ineffective. However, when I do the same with just crontab -e (as pi user) it works as intended.

I have a vague memory as to why this is the case but I can't recall and would love to learn what the holdup is.

4
  • Trying to do start ANY GUI program from cron is an exercise in futility.
    – Milliways
    Oct 10, 2021 at 1:14
  • Is this because cron might not run within a GUI environment? Oct 10, 2021 at 16:29
  • It might be possible. Have you looked at this approach? - or this cron-gui-launcher project on GitHub?
    – Seamus
    Oct 11, 2021 at 6:00
  • I ended up just uses autostart, thanks! Sometimes it can be overwhelming how many ways there are to do something... Oct 11, 2021 at 15:14

1 Answer 1

0

The correct way to start a GUI app is with autostart. There are many examples on this site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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