vectraboyv6
Posts: 43
Joined: Fri Aug 17, 2012 11:28 am

screensaver in X for webpage console

Sun Jun 04, 2017 6:11 pm

Hi all,

I can not believe then hassle i'm having trying to get a simple screensaver to work. Something that would take seconds in a windows 7 environment... Any how.. I have a chromium full screen kiosk running some basic home automation.. The 12" touchscreen stays lit and live at all times. The wife asked if we could have a screensaver of family pictures on it when not in use.. Hey no problems I said :(

Ive installed xscreensaver but no option for pictures there...

Ive install FEH and while this works with a simple bash script, I cannot or it will not map the left hand mouse click to a quit command. (/usr/feh/buttons) The thinking is now is to use xinput to monitor the mouse click and then issue a kill command on feh. this may be quite resource hungry.. is there a quicker way by chance?

i'm a relative newbie, can some one go over my coding for me as i'm at a dead end with it.

thanks Stuart

Code: Select all

#!/bin/bash
# screensaverfull.sh

# url: ###
# This script is licensed under GNU GPL version 2.0 or above

# Uses elements from lightsOn.sh
# Copyright (c) 2011 iye.cba at gmail com
# url: https://github.com/iye/lightsOn
# This script is licensed under GNU GPL version 2.0 or above

# Description: ####
# screensaverfull.sh needs xprintidle and feh to work.

# HOW TO USE: Start the script with the number of seconds you want the checks
# for fullscreen to be done. Example:
# "./screensaver.sh 120"

DIR=$( cd "$( dirname "$0" )" && pwd)
delay=$1


# If argument empty, use 60 seconds as default.
if [ -z "$1" ];then
    delay=60
fi

# If argument is not integer quit.
if [[ $1 = *[^0-9]* ]]; then
    echo "The Argument \"$1\" is not valid, not an integer"
    exit 1
fi

IDLE_TIME=$(($delay*1000))

cd $DIR
while sleep $((1)); do
    idle=$(xprintidle)
    if [ $idle -ge $IDLE_TIME ]; then
        feh -x -F -r -Y -Z -z -A -1 slideshow -D 7 $DIR
		FEHPID=$!

    fi
		state="$(xinput  --query-state 6)"
	# if mouse 1 is pressed
	if [[ "$state" == *"button[1]=down"* ]]; then
		echo "left mouse"
		FEHPID=$!
		kill -s 9 $FEHPID
	fi
done

exit 0

Heater
Posts: 10013
Joined: Tue Jul 17, 2012 3:02 pm

Re: screensaver in X for webpage console

Sun Jun 04, 2017 8:07 pm

Given that you have a web app running full screen all the time why not build the picture viewer into it's HTML and Javascript?

klricks
Posts: 5899
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: screensaver in X for webpage console

Mon Jun 05, 2017 2:36 am

To get a slideshow of sorts in xscreensaver:
Install extra addons:

Code: Select all

sudo apt-get update
sudo apt-get install xscreensaver-data-extra 
sudo apt-get install xscreensaver-gl
sudo apt-get install xscreensaver-gl-extra

Start Screenaver from [Menu]--> [Preferences]

Click [Advanced] tab
In Image Manipulation pane tick: Choose Random Image
Browse to the folder where your photos reside.

Click back to [Display Modes] tab
Set Mode: Only One Screensaver
Select: GLSlideshow
Click [Settings] button and adjust settings.
You may have to experiment here if you don't want the panning and zooming. I choose image 100%, Pan/zoom 1, Crossfade None

There are several other screen saver modules in the picklist such as Ripples that work the images in the selected path. Non that can do sequence... Only random.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

vectraboyv6
Posts: 43
Joined: Fri Aug 17, 2012 11:28 am

Re: screensaver in X for webpage console

Mon Jun 05, 2017 7:40 am

thanks will give these a look

have done the extra bits on xscreensaver and these have worked a treat.

many thanks again

Return to “General discussion”