1

hopefully one of you bright sparks will be able to help. I have a project to make my Raspberry Pi into a slideshow, ideally I wanted this to run from startup, here is what I have done so far;

  • Installed Raspbian (Jessie with Pixel) on the Raspberry Pi
  • Installed feh (sudo apt-get install feh) to run my slideshow
  • Installed xScreensaver (sudo apt-get install xscreensaver) to control the screensaver so it doesn't kick in while the slideshow is running.
  • Placed my images for the slideshow on a USB stick

Now I can run the slideshow from the terminal just fine using the following;

feh -Y -x -q -D 5 -B black -F -Z -z -r /media/

I wanted to create a script for it so I didn't have to keep typing that in, and also I wanted it to run at startup, so I created the script and saved it on the desktop, the contents of the script were as follows;

#!/bin/bash
echo "Starting the slideshow..."
sudo feh -Y -x -q -D 5 -B black -F -Z -z -r /media/ &

After I save it (named slideshow.sh) I make the script executable by typing the following into the Terminal;

sudo chmod 755 Desktop/slideshow.sh

Now I think this is where my problems start, When I try to open this script file by double clicking it I get a popup saying 'this text file seems to be an executable script. What do you want to do with it', I then get the following options

  • Execute
  • Execute in Terminal
  • Open
  • Cancel

Now when I click either Execute or Execute in Terminal nothing happens.

I have also edited the rc.local file and added a link to the script file in here to be run on startup, now I'm not sure if this is working or not because my script doesn't appear to be working, I'm sure if I can get the script file to work first then this bit should also start working.

Hoping to find a fix for my issue.

Thanks

David Coles
  • 45
  • 1
  • 11
  • [Auto-execute desktop shortcut problem](https://raspberrypi.stackexchange.com/questions/100679/auto-execute-desktop-shortcut-problem) might help. – ggorlen Mar 01 '21 at 21:46

2 Answers2

0
  1. For your script to work, you have to remove the '&' from your script. '&' means run as background

    #!/bin/bash
    echo "Starting the slideshow..."
    sudo feh -Y -x -q -D 5 -B black -F -Z -z -r /media/
    
  2. Adding the command to the rc.local does not work as commands in rc.local are executed before your desktop gets loaded.

    To run the command after your desktop loads, follow this guide Auto Running Programs-GUI

akgren_soar
  • 337
  • 4
  • 9
0

To run it all you have to do is add #!/bin/bash echo "Starting the slideshow..." sudo feh -Y -x -q -D 5 -B black -F -Z -z -r /media/ To the file init.d. This file is executed on startup of the GUI!

Will4cat
  • 46
  • 4