auto-start a program on boot

!!!!!!!!!!!!!*******************************!!!!!!!!!!!!!

NEW TECHNIQUE FOR NEWER VERSIONS OF OS

!!!!!!!!!!!!!*******************************!!!!!!!!!!!!!

for new versions of the os follow these instructions .Autostart works different on the newer releases.

this is for Bookworm on a RPi5.

Open the File Manager and select View -> Show Hidden.

You should see a .config folder. Change to that folder.

Right click on the list of files and select “New Folder”.

Enter “autostart” as the name.

Now you should have a “./.config/autostart” folder.

Create a file named “test.desktop” in the “./.config/autostart” folder.

In it type……

Type=Application

Name=Chromium

Exec=chromium

Terminal=false “

Set the file permissions on test.desktop file as “executable by anyone”

Reboot.

Edit: You can move or copy a desktop file from your /Desktop folder,

If it runs there when you double click it, it will autostart in the “./.config/autostart” folder.

BELOW IS THE OLD WAY

open a text document.

save it , onto the desktop as

startup.sh

Untitled 3then open terminal and type in (really important this)

sudo chmod 755 /home/pi/Desktop/startup.sh

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

then right at the bottom add

@/home/pi/Desktop/startup.sh

then exit and save (ctlt x , y , return)

Untitled 4

this will now open this file every time the computers boots up.

to get it to do something open startup.sh in text editor and type

sleep 2

pd /home/pi/Desktop/pdtest.pd

then save it

Untitled 4j

now if we test this by opening this file by double clicking then choosing Execute

it waits for 2 seconds, then opens Pd with the patch pdtest.pd, which is found at /home/pi/Desktop/pdtest.pd

Untitled 3kk

Untitled 2kk

if we don’t want this to happen every time the pi boots up, rename the startip.sh file to something else, this file can also be modified to open any application or process .