Hi
I would like to start a bash script or preferably a python script in a terminal window after I have booted into X.
The reason is that my project needs to auto start after plugging in power and booting the rpi without any other inputs.
I have tried crontab, rc.local and /etc/xdg/lxsession/LXDE/autostart without success.
Both scripts are located in /home/pi/Python_kode/Kattedetektor. My bash script is called autostart.sh and looks like this:
#!/bin/bash
echo "Running my python sript in another terminal window"
sleep 10
Exec=sudo lxterminal --command "sudo python3 /home/pi/Python_kode/Kattedetektor/kattdet.py"
$SHELL
The actual file I want to run is "kattdet.py" but I thought it would be easier to start it via crontab or rc.local if it was initiated from a bash script.
If I run "/home/pi/Python_kode/Kattedetektor/autostart.sh" from terminal it runs just fine. Also if I run "sudo python3 /home/pi/Python_kode/Kattedetektor/kattdet.py" that starts up directly like it should.
I find it strange that it is so hard to automatically start a script or python file after booting the rpi, one should think that this is a common used feature?
Can anyone help me?