Raspberry Pi Disable Screensaver

Had a raspberry pi setup as a terminal to display statistics on a television – needed it to not go into sleep mode etc.

SSH or login to your RPi as root
I added the following script

# needs apt-get install x11-xserver-utils first
# if something errors, stop the script
set -e

# set the screensaver to off, no power savings, and no blank screen
xset s off
xset -dpms
xset s noblank

# exec the session manager so you have a toolbar still
exec /etc/alternatives/x-session-manager

I then added a path to rc.local
chmod +x YOURSCRIPTNAME.SH
chmod 777 YOURSCRIPTNAME.SH

nano /etc/rc.local
Add “/path/to/your/script.sh”

***EDIT***
Apparently that does not work – you end up getting a “cannot change display “”” type of argument.

So, change the LXDE autostart function script:
nano /etc/xdg/lxsession/LXDE/autostart

xset s off
xset -dpms
xset s noblank
reboot.

Leave a Reply

Your email address will not be published. Required fields are marked *