mohamedhamad
Posts: 4
Joined: Thu Aug 16, 2018 3:32 am

Raspberry pi display sleep time of touch screen

Thu Aug 16, 2018 3:37 am

I’m trying to figure out how to set the display sleep setting on my pi with the official touch screen to something like 20-30s.
I’ve created a magic mirror setup, n I want it to turn on the display on screen tap, n then turn off after 20-30s.
I tried installing XScreenSaver but that didn’t work n after setting it to 1min to turn off the display, nothing happened.
All message boards n threads pertain to never turning off the display, but want the display to turn off quickly.
How can I do this?

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

Re: Raspberry pi display sleep time of touch screen

Thu Aug 16, 2018 1:25 pm

mohamedhamad wrote:
Thu Aug 16, 2018 3:37 am
I’m trying to figure out how to set the display sleep setting on my pi with the official touch screen to something like 20-30s.
I’ve created a magic mirror setup, n I want it to turn on the display on screen tap, n then turn off after 20-30s.
I tried installing XScreenSaver but that didn’t work n after setting it to 1min to turn off the display, nothing happened.
All message boards n threads pertain to never turning off the display, but want the display to turn off quickly.
How can I do this?
Does the default 10 minute screen blanking work with the official touchscreen? If so the try xset commands.

Code: Select all

xset s 30
This works with HDMI screens but not sure about official touchscreen?
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

mohamedhamad
Posts: 4
Joined: Thu Aug 16, 2018 3:32 am

Re: Raspberry pi display sleep time of touch screen

Fri Aug 17, 2018 3:12 am

Thanks for the suggestion, just tried the command and got this message

Code: Select all

xset: unable to open display “”

mohamedhamad
Posts: 4
Joined: Thu Aug 16, 2018 3:32 am

Re: Raspberry pi display sleep time of touch screen

Fri Aug 17, 2018 3:17 am

Ok, found out I had to set the display first with

Code: Select all

export DISPLAY=:0

mohamedhamad
Posts: 4
Joined: Thu Aug 16, 2018 3:32 am

Re: Raspberry pi display sleep time of touch screen

Fri Aug 17, 2018 4:01 am

Looks like that did the trick! Thank you for your help!

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

Re: Raspberry pi display sleep time of touch screen

Fri Aug 17, 2018 5:24 am

mohamedhamad wrote:
Fri Aug 17, 2018 4:01 am
Looks like that did the trick! Thank you for your help!
Note that you will need to run the xset command after each boot. One way to to that is to put the command in autostart.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

Return to “Raspbian”

Who is online

Users browsing this forum: gkreidl, rpiMike and 29 guests