Systemd with desktop App? Or another Auto Start Method?

Hello all,

Is there a way to use systemd to autostart a desktop app on Raspberry Pi? I cannot get this to work, probably because it is not a console/daemonized app.

Suggestions appreciated!
Thanks,
Tim

I did this on Raspberry PI and Orange PI (Armbian)

Luckily I saved the relevant info I used:

Autologin:

Open the file /etc/lightdm/lightdm.conf and navigate to line 78 (you can enable line numbers on Leafpad).

It should be saying #autologin-user=.

Put user in sudo group:

sudo gpasswd -a pi sudo

In principle, this makes any other user a system administrator.
However, this change will only take effect after the user has logged out and back in, provided that the user “pi” was not already in the user group “sudo”.

Start app on login:

sudo nano /etc/xdg/autostart/display.desktop

[Desktop Entry]
Name=PiCounter
Exec=/usr/bin/python3 /home/pi/PiCounter/display.py


/usr/local/bin/startwise.sh
chmod 777

So thats the info I used to get it done…

On the Orange PI I was able to let it start headless, Xojo desktop app and App had focus so it was ready to get barcode reading from Keyboard Barcode scanner.