Auto-run LXTerminal from LXDE desktop at startup

The script may be running to completion and the terminal closes before you see it. Test to see if it works using a script that waits for input, so the terminal will stay open until you close it.

Create a test script. I just named it “test.sh”, make it executable.

Code:

#!/bin/bash

pause(){
 read -n1 -rsp $'Press any key to close the terminal...\n'
}

echo Script is running

pause

Then edit the autostart file

Code:

nano ~/.config/lxsession/LXDE-pi/autostart

Add this line at the bottom

Code:

lxterminal -e /path/to/test.sh

Then log out and back in, or reboot. When the desktop starts you should see the terminal open in the middle of the screen, waiting for you to press a key. That will confirm everything’s working, then edit the autostart file and replace “/path/to/test.sh” with the script you want to use.

inspirational quotes:  https://www.raspberrypi.org/forums/viewtopic.php?t=65607

Deixe uma resposta

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *