Hello there,
I'm using RaspberryPi and python graphical application to control some stuff. Critical for me is fast boot time. I'm using Raspbian Lite with some adjustments like disabling most of services etc, to aquire boot time less than 4 seconds.
However, my python app uses Tkinter, so it's need some kind of GUI. Normal desktop is to heavy for me, so I'm just using xinit or startx (both of them works fine.
So basicly, after boot I have to type in console:
xinit (or startx)
And then in newly opened xinit/startx console:
cd pythonApp/.../Main (just path to directory)
sudo python3 application.py
Btw, by some reasons if I'm trying to type 'sudo python3 pythonApp/.../Main/application.py', application won't start(occurs some problems with imports), when with 'cd pythonApp/.../Main' and then 'sudo python3 application.py' works fine...
How I can automate whole the process, to just power up RaspberryPi and have autostarted xinit with python script?
I know that I can run xinit with systemd, but that's not enough. Still I have to run commands 'cd pythonApp/.../Main' and then 'sudo python3 application.py'.