i've been searching for hours trying to find a solution to this, what should be a simple problem. I've setup my pi to run a sh script at startup that uses omxplayer to play a folder full of videos. this works perfectly fine when booting to the desktop, but between every video, it flashes the desktop for a second or so until the next video loads. i'd like to boot to cli and have this script run but i can't seem to figure out how. If i boot to cli (auto login as pi) and run the script manualy, it works perfectly fine.

currently, my script is at /home/pi/Documents/slideshow.sh

i tried:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

and added the line

@sh /home/pi/Documents/slideshow.sh

which works fine in the gui but not when booting to cli. i've also tried using /etc/rc.local instead, but it also doesn't work at the cli.

i installed unclutter to hide the mouse cursor, which works, but even though the taskbar is set to autohide, it still shows up between every video.

are there any startup locations i can use to call a sh script that will launch when booting to the cli?

1 Answer 1


As far as I understand you are booting to the command line interface and have an auto login of user pi. On start of a login shell the file ~/.profile is executed. So you can try to append at the end of the file:

~/Documents/slideshow.sh &

The & at line end ensures that the script is send to the background and ~/.profile finishes. Otherwise the login will stuck and you don't get a login prompt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.