1

I am booting my raspberry Pi to Terminal at the moment.

I have a script that I would like to run. The script looks like this run_gui.sh:

python /home/pi/1.py &
/home/pi/Gui&

If I SSH into machine or if I just run run.sh from the terminal everything works fine. The program which is a full-screen QML (QT) application takes over the screen and then I can use the touch screen to navigate.

I would like to execute run.sh at startup, so I don't have to run it manually every time.

So I added have /home/pi/run.sh to /etc/rc.local When I reboot the system now, I can see that the script is indeed executed since the user interface gets shown, but for some strange reason, there is a cursor visible on the screen, if I use the mouse and click around everything still works but the touch screen is not responding anymore.

Is there any difference between running a script from terminal/SSH or placing it in /etc/rc.local

  • 1
    Yes, /etc/rc.local is not executed as a regular user, and runs earlier (perhaps before touchscreen drivers have time to start). – Dmitry Grigoryev Apr 10 '17 at 11:56
  • @DmitryGrigoryev, so from where should I start the application? – theAlse Apr 10 '17 at 12:10
  • For starters, try adding a delay to let your system more time to boot. Or you could boot to desktop and do what Jot suggested. – Dmitry Grigoryev Apr 10 '17 at 12:15
  • Do you use X11 or framebuffer? How about starting your app as a service? That's what I usually do with Qt applications I'd like to run all of the time. On a different system I could get rid of an unwanted cursor by systemctl disable getty@ttyS0 – Philippos Apr 10 '17 at 14:21
1

To start a script or program in the desktop as a normal user (not as root), you can make a desktop file in the ~/.config/autostart folder: Adafruit: adding vncserver autostart

  • Note that the OP boots his raspberry Pi to Terminal. – Dmitry Grigoryev Apr 10 '17 at 11:59
  • I am booting to terminal not x. your solution would not work. – theAlse Apr 10 '17 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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