Why doesn't a GUI application in crontab open with auto-login?

0

I want to start a GUI application through crontab on reboot. I have setup the crontab as @reboot export DISPLAY=:0 && ./myscript.sh and it works perfectly fine when auto-login is disabled i.e. I need to manually enter password to login.

However, when auto-login is enabled, the crontab still works but the GUI application is not launched.

Why does this happen?

tytywin

Posted 2019-08-22T17:37:03.333

Reputation: 33

This sounds like an XY Problem to me. What, exactly, are you trying to achieve here by starting a graphical application on system startup?

– Austin Hemmelgarn – 2019-08-22T18:30:33.990

So I have an application (which displays camera feed, if that helps) that I need to run as soon as I login. Rather than have the user click on the application executable, it's more convenient if it just starts up on boot up. I want the user to be as less involved in the process (logging in, clicking on application etc) as possible. – tytywin – 2019-08-22T18:39:12.440

So is this for a kiosk-type thing (that is, single application, user only sees that application, can't do anything outside of that application), or is it just something you need to have started as soon as the desktop environment starts? – Austin Hemmelgarn – 2019-08-22T18:41:40.207

Both actually. Single application, user can't do anything outside of that application and it should start at boot. And as I said, it's showing feed from the camera so user does not really have to interact with it.. – tytywin – 2019-08-22T18:46:07.737

2The easiest option for just simple usage is probably going to be using the autorun functionality native to whatever desktop environment you're using (all the major ones have some way to auto-start applications and scripts on user log-in). The harder, but more reliable way is going to be defining your own Xsession, which controls exactly what gets invoked when a graphical login happens. – Austin Hemmelgarn – 2019-08-22T18:48:04.283

No answers