What am I doing wrong?
Quite a lot really but your biggest omission is not having any way to capture any error messages that might be being thrown. Without those all anyone can do is guess.
Some pointers:
- Dropping a random shell script into $HOME/.config/autostart is unlikely to work.
- Your first Start.sh script is odd and I'm surprised it works:
- Does your .bashrc activate your venv?
- Your use of "exec bash" seems problematic. It will replace the current shell with a new bash and probably won't allow the rest of your script to run.
- The simplest way to activate a venv for a single python script is to call the interpreter that is inside the venv e.g:
Code:
$HOME/.pyenv/bin/python /OpenHomeKaraoke/app.py -d /mnt/Karaoke -V -nv -hq - Your second Start.sh is simply incorrect:
- It's not a valid shell script.
- it looks like it is a valid autostart file for lxde. The default desktop doesn't use that anymore.
- If you are using X11/lxde you put it in the wrong place. Try $HOME/.config/lxsession/LXDE-pi/autostart
Code:
Exec=/bin/bash -c "source ~/.bashrc; export PATH="$HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH"; export PYENV_VERSION="3.9.5"; python3 /home/myuser/OpenHomeKaraoke/app.py -d /mnt/Karaoke -V -nv -hq; python3 /home/myuser/OpenHomeKaraoke/app.py -d /mnt/Karaoke -V -nv -hq- That's not going to work as you expect.
- You can't nest quote marks of the same type. Bash will see it as
- "source ~/.bashrc; export PATH="
- $HOME/.pyenv/shims:$HOME/.pyenv/bin:$PATH
- "; export PYENV_VERSION="
- 3.9.5
- "; python3 /home/myuser/OpenHomeKaraoke/app.py -d /mnt/Karaoke -V -nv -hq; python3 /home/myuser/OpenHomeKaraoke/app.py -d /mnt/Karaoke -V -nv -hq
For more details read my guide as linked to by DS256.
Statistics: Posted by thagrol — Sun Aug 17, 2025 1:44 pm