Auto strat app on desktop use custom.sh Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
Post Reply
tcornilleau
Posts: 3
Joined: Mon Jan 04, 2021 9:26 am

Auto strat app on desktop use custom.sh

Post by tcornilleau »

Guys I am looking for help on how to setup an auto start of an app once desktop is running.

I tried boot scripts via dietpi-config > AutoStart options > Custom. I added my command to /var/lib/dietpi-autostart/custom.sh

Code: Select all

#!/bin/bash
#---Examples---

# - Chromium
#xinit chromium

# - LXDE
#startx

# - Print hello
#echo -e "Hello"

#---Put your code below this line---
echo -e "Start in few second"
sleep 15
echo -e "start"
sleep 4
startx
sleep 10
./home/dietpi/electron-tutorial-app-linux-armv7l/electron-tutorial-app


but durring the sleep, i could see on the console the login banner ask to "hit enter" and then when the command startx is call the desktop start but i got an error popup "no session for pid 658" then the electron-tutorial-app didn't strat. :cry:

however when i call the command

Code: Select all

systemctl status dietpi-autostart_custom
i got an "Active: active (running)"

hope i was clear

Much Thanks in advance
User avatar
Joulinar
Posts: 5149
Joined: Sat Nov 16, 2019 12:49 am

Re: Auto strat app on desktop use custom.sh

Post by Joulinar »

Hi,

many thanks for your message. I guess you are trying to start automatically an application once desktop was started. Correct?

dietpi-autostart/custom.sh might not be the correct place.

Maybe you can have a look to the following links
https://www.raspberrypi-spy.co.uk/2014/ ... e-desktop/
https://learn.sparkfun.com/tutorials/ho ... -autostart
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
tcornilleau
Posts: 3
Joined: Mon Jan 04, 2021 9:26 am

Re: Auto strat app on desktop use custom.sh

Post by tcornilleau »

hi Joulinar :)

It works !!

I used the methode 1 of https://www.raspberrypi-spy.co.uk/2014/ ... e-desktop/ with the add of the ligne

Code: Select all

@/directory/of/my/app/myapp
to the /etc/xdg/lxsession/LXDE/autostart.

Thanks for you help ! :)
Post Reply