Enable screensaver/blank screen for RPi touchscreen

Hey there. First-time visitor here.
I know that most people want to turn screensavers off, but how would I enable it for the Raspberry Pi 7’’ toucshcreen? I would like to run OctoPrint on it and I want it to blank the screen (also disable the backlight) when I am not touching it.
Any help is appreciated.

1 Like

Did anyone get this working? Looking to do the same with Chromium auto launching. Had it working with Mate desktop and chromium but want to do this with autostart straight to Chromium.


can you try running xset q once chromium was started.

I, too, would like to do this. When I ran xset q as root it spat out xset: unable to open display “”

Edit: I did some more searching and discovered this thread which says to run export DISPLAY=:0 first which then let me run xset commands without issue. I was able to run xset s 10 && xset -dpms which set the screensaver to 10s and disables DPMS (EnergyStar) features. It wakes up on touch. NEAT :smiley:

Edit 2: Note that both commands need to be run for each boot. I created a script at /etc/profile.d/screensaver.sh that has:

export DISPLAY=:0
xset s 10 && xset -dpms

which autoruns on login


i’ve tried as you described and screen blanks fine after 10 sec but i can’t wake up on touch… it stays blank.
also wake up on keyboard or mouse doesn’t work… in fact i have to pull the plug to get a screen again :frowning:

any idea what’s the cause for this ?

best regards


Odd, I didn’t have to do anything special to allow touch or keyboard to wake mine up. I’m running a pretty fresh install of DietPi with just Pi-Hole and Chromium kiosk autorun. Running uname -a says:

Linux DietPi 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux

My limited searching revealed that people who had this problem on Raspbian were able to fix by doing an apt update / upgrade, however that was several years ago :thinking:


i’ve installed DietPi from scratch and now it’s working when i start it manually in terminal like you described.
it wakes on touch also…

do you know if it’s possible to prevent the “wake-touch” to get recognized as click input ?
because i don’t want to accidently start/stop things which i can’t see when i wake the screen …

similar like it’s described here:


unfortunatly i can’t get backlight_dimmer working with dietpi … i keep getting error msgs like display-manager.service not found and so on…

I’ve been looking for a way to get the screen turn off after some time automatically for a few days now. Putting my tweaked script into this folder was the only working solution after manually disabling xscreensaver. Thanks.

For my my own future reference.

DISPLAY=:0 xset dpms 60 60 60

thx for sharing your solution.

I found a different one:
moved away the file (for backup purposes) /etc/X11/xorg.conf.d/98-dietpi-disable_dpms.conf
and made a new one: /etc/X11/xorg.conf.d/90-display_off.conf:

Section "ServerFlags"
    Option "StandbyTime" "0"
    Option "SuspendTime" "0"
    Option "OffTime" "5"

This enables switching off the display after 5 minutes.

o you know if it’s possible to prevent the “wake-touch” to get recognized as click input ?
because i don’t want to accidently start/stop things which i can’t see when i wake the screen …

For this see my own answer in Don't recognize wake touch as input.

1 Like


do I understand you right, that I can use this to turn off my screen after 5min, when I’m using Octopi with Octoscreen or will it not work?

Do I have to install additional tools from the normal ones I already installed through octoscreen and octoprint?

I don’t know know what Octopi and Octoscreen ist. I’d suggest: try the solution and report here.