2

I am running raspbian and my pi boots straight to desktop. I am wondering how I could schedule a script to run at boot to desktop and not at power-on.

asked Apr 17, 2016 at 16:02

4 Answers 4

1

Did exactly the same in my Raspberry PI. Add the command to run your application to ~/.config/lxsession/LXDE/autostart as it follows:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@python /home/pi/python_cool_stuff/yourscript.py
answered Jun 17, 2016 at 11:00
0

You use two ways here :

  • using rc.local to shell-scripted desktop detection and running your script at the right time
  • using your desktop environment's autorun capabilities. startx script can utilize .xinitrc scripts by auto-including and executing them. In case that you need to exec your script after/inside not just a GUI, but a display manager - read its man page. The default LXDM is well-documented here. Basically you'll just use a .desktop file
answered Apr 17, 2016 at 16:17
0

I use this for a reboot button.

sudo nano /etc/rc.local

Then, above the last line:

python /home/pi/scripts/reboot.py &

answered Oct 4, 2017 at 20:44
1
  • /etc/rc.local is executed when the OS is starting, the /home/user/.bashrc is executed when a user login. Commented Oct 4, 2017 at 21:06
-1

I had the same requirement. I found the best way was using cron. Best thing about cron is you do not need to login and you can fully control the process, how many time to run, when to run etc..

See this Link

answered May 17, 2016 at 20:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.