Friday, 30 August 2013

Getting the Pi to Auto-Start (Step 7)

To get the Pi to go straight to the desktop on start-up:
  • In the LX terminal type sudo raspi-config and a menu should appear where you can select to change the configuration for startup, so that when you start the pi it will skip the login step and the startx step and go straight to your desktop.
To get a python programme to run automatically:
  • In the /home/pi/.config directory create a folder called 'autostart'.
  • In Leafpad create a file called 'mypythonprogram.desktop' and write the following code and save it to the directory /home/pi/desktop/ :
                        [Desktop Entry]
                        Encoding=UTF-8
                        Type=Application
                        Name="The name of your program"
                        Comment=
                        Exec=sudo python "The place where the program is saved for
                                                         instance /home/pi/mypython.py"
                        StartupNotify=false
                        Terminal=false
                        Hidden=false
  • Then cut and paste the file into the autostart folder you created.
  • Test it to see if it works by typing sudo reboot into the LX terminal. 
  •  
     

No comments:

Post a Comment