Hi,
Today, I am goung to show how to run program at startup of Raspberry Pi. There are type to run program, whether before desktop is login/finished loaded or not even enter to desktop environment.
Run Program after Desktop Environment
-
Go to : cd /home/pi/.config/lxsession/LXDE-pi/ sometime, the location of lxsession will be at another location such as:
cd /etc/xdg/lxsession/LXDE/
-
Create a file name autostart: sudo nano autostart
- In that file, put this command
@lxpanel –profile LXDE-pi
@pcmanfm –desktop –profile LXDE-pi
@/home/pi/program.py
Notes: program.py is the program that you want to run.
If not work, please follow this website:
https://learn.sparkfun.com/tutorials/how-to-run-a-raspberry-pi-program-on-startup/method-2-autostart
Run Program after Desktop Environment
-
Go to : cd /home/pi/.config/lxsession/LXDE-pi/
-
Create a file name autostart: sudo nano autostart
- In that file, put this command
@lxpanel –profile LXDE-pi
@pcmanfm –desktop –profile LXDE-pi
@/home/pi/program.py
Notes: program.py is the program that you want to run.
Run Program before Desktop Environment
-
Go to : cd /home/pi/.config/lxsession/LXDE-pi/
-
Create a file name autostart: sudo nano autostart
- In that file, put this command
@/home/pi/program.py
Notes: program.py is the program that you want to run.