Reshi
Posts: 3
Joined: Thu Jan 07, 2016 6:43 am
Location: USA

Screensaver Slideshow (how can it be done?)

Thu Jan 07, 2016 7:23 am

I thought this would be fairly easy, but I can't figure out a good way to get my Pi 2 to switch to a photo slideshow if left idle for a few minutes. I'd like to have it serve as a digital photo frame, but I don't want to have to manually stop/start a slideshow application such as feh every time I want it to show images, for I still use my Pi for other purposes.

I've tried using xscreensaver, but glslideshow does not work on the PI.
I've also tried using the "ripples" theme with the ripple effects minimized, but it displays an annoying checkerboarding pattern for several seconds between images.
I've also tried using qiv, but it "blanks the screen after showing a few pictures", as user hako describes.

Surely there is an easy way to accomplish this?

User avatar
karrika
Posts: 1051
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: Screensaver Slideshow (how can it be done?)

Thu Jan 07, 2016 7:48 am

You could write your own screensaver based on feh. This also requires "sudo apt-get install xprintidle" to allow the Raspberry Pi to find out when the Pi is idle.

https://raw.githubusercontent.com/jamcn ... ensaver.sh

The article about this hack is here:
http://jamcnaughton.com/2014/09/05/simp ... or-ubuntu/

The article also mentions how to disable blanking, well kind of. I still believe the blanking could better be set through "setterm -blank 0".

Reshi
Posts: 3
Joined: Thu Jan 07, 2016 6:43 am
Location: USA

Re: Screensaver Slideshow (how can it be done?)

Fri Jan 08, 2016 5:41 am

Thanks karrika.

This is exactly what I'd been searching for. It took some fiddling with to get it to run automatically on startup, but it works great now.

QuietZone
Posts: 89
Joined: Sat Dec 05, 2015 7:13 pm

Re: Screensaver Slideshow (how can it be done?)

Fri Jan 08, 2016 5:45 am

Reshi wrote:Thanks karrika.

This is exactly what I'd been searching for. It took some fiddling with to get it to run automatically on startup, but it works great now.
Can you explain here, step by step in recipe fashion, how to get this up and running?

I, too, need this functionality. No point in my re-inventing the wheel, given that you've managed to get it working, right?
"If you haven't got anything nice to say about anybody come sit next to me." — Alice Roosevelt Longworth

Reshi
Posts: 3
Joined: Thu Jan 07, 2016 6:43 am
Location: USA

Re: Screensaver Slideshow (how can it be done?)

Fri Jan 08, 2016 7:37 am

I would start by following the guide in the link posted by karrika:
http://jamcnaughton.com/2014/09/05/simp ... or-ubuntu/

The basic steps are:
1.) Install feh
2.) Install xprintidle

Code: Select all

sudo apt-get install feh
sudo apt-get install xprintidle
3.) Save the screensaver.sh bash file created by J.A.McNaughton in the same directory that your images are contained (or use screensaverwithlock.sh, but I didn't test this one). One way to do this is to simply copy the code text in the link, paste it into a text editor, and save it. Again, here is the link: https://raw.githubusercontent.com/jamcn ... ensaver.sh

At this point, entering the following line into a terminal (with your file path and input argument time) should give you a basic slideshow screensaver that starts after [time] seconds of being idle:

Code: Select all

bash path/to/script/screensaver.sh time
I found that pressing escape will exit the slideshow.

The next step is to make it run on startup, and this is how I did it.
4.) Create a bash script that will execute your screensaver.sh script upon launching startx. To do this, put the following in a text editor:

Code: Select all

#!/bin/sh
bash path/to/script/screensaver.sh time
Again, use your file directory and desired idle [time].

5.) Save this script in your /home/pi/bin directory. If this directory doesn't already exist, then you need to create a folder called bin in your /home/pi directory. The user created ~/bin folder is by default in the path, so you should be able to call any scripts and executables in it (like our bash script) without changing your directory.

6.) Open the autostart text file in both the /etc/xdg/lxsession/LXDE and /etc/xdg/lxsession/LXDE-pi directories, and add a new line at the bottom with the name of the script file you created in step 5, preceeded by the @ symbol, and save. For example, I named my file "start-screensaver", so my autostart files now look like this:

Code: Select all

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@start-screensaver
Note: I'm pretty sure you only need to do it for one of the files, but I'm not sure which and doing both didn't seem to hurt.

It should now run your script, thus running the screensaver.sh script, upon launching startx.

This has worked for me, but I should tell you that I'm new to Linux and have only had a Pi for a couple of days, so I'm sure there are better ways of doing this. I also can't guarantee that this will definitely work for you, but I hope it helps.

SparkyLurch
Posts: 1
Joined: Mon Jun 27, 2016 9:06 am

Re: Screensaver Slideshow (how can it be done?)

Mon Jun 27, 2016 9:35 am

Thank you Reshi for the good examples and explanations here, I have set up a Pi to run a calendar and I wanted it to display a slide show whilst idle.

I have followed these instructions fairly closely however the only thing that I can get to work is the autorun function.

I have created the startup script ¨run-ss¨ and placed it in /home/pi/bin (I also copied it into /bin)
if I bash this file, the slideshow works.
run-ss

Code: Select all

#!/bin/sh
bash /media/pi/9FB9-A8C9/screensaver.sh 20
I modified the autostart files in /etc/xdg/lxsession/LXDE and /etc/xdg/lxsession/LXDE-pi to run the startup script

contents of autostart file: (both the same)

Code: Select all

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@run-ss
@iceweasel
if I just do bash /media/pi/9FB9-A8C9/screensaver.sh 20 it will also work.
Now I did modify the actual screensaver script as I wanted it to run over the top of the calendar which is fullscreen so I had to gt rid of the fullscreen checking and stopping but seeing as it seems to work when I bash it I think its just the autostart I am having trouble with.

I don´t know if anyone can see anything that I have done wrong here?
Any help would be greatly appreciated, let me know if I can provide any more info or anything.

davinun99
Posts: 1
Joined: Mon Jan 21, 2019 7:51 pm

Re: Screensaver Slideshow (how can it be done?)

Mon Jan 21, 2019 7:53 pm

Hey I tried this and it worked perfectly but it stop sometimes, after an hour or so, anyone know how to prevent or fix this?

Return to “Media centres”