neovanmatix
Posts: 3
Joined: Wed Jan 08, 2014 8:28 am

Run script if screensaver is active?

Sat Jan 11, 2014 3:53 pm

Hi there,
is it possible to run a program/script when the default screensaver starts and ends?
I've attached a little PiTFT-display which a backlight which i can control via GPIO.

Actual, the display is getting black but the backlight is still on.

I've found nothing, how i could start scripts when the default screensaver is starting/ending; maybe someone could give me an hint?

User avatar
DougieLawson
Posts: 35784
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Run script if screensaver is active?

Sat Jan 11, 2014 11:59 pm

Pull the source code: http://www.jwz.org/xscreensaver/xscreen ... .26.tar.gz

You can probably replace ../xscreensaver-5.26/driver/dpms.c with your own version to switch off/switch on the backlight by twiddling the GPIO pin.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

KyleBoyer
Posts: 1
Joined: Wed Mar 25, 2015 11:56 pm

Re: Run script if screensaver is active?

Wed Mar 25, 2015 11:57 pm

Was there a solution to this? I am looking into the same idea, and I'm surprised there isn't a solution yet.

florca
Posts: 32
Joined: Fri Jun 29, 2012 7:54 pm
Location: South Devon, UK

Re: Run script if screensaver is active?

Thu Mar 26, 2015 7:39 am

Yes, there's a simple solution here which you could adapt.

https://github.com/ramses0/xscreensaver-pi-hdmi

After this was written there's a new "vcgencmd display_power 1 | 0" command to turn HDMI power on | off, which I've edited the script to run instead of the current approach. I use it as originally designed to control the power on the HDMI monitor.

Phil

Return to “Raspbian”