Hyperpixel 4.0 Putting Display to Sleep

Is it possible to turn the display on and off via the command line please?

Failing that, can the display be dimmed via command line?


DISPLAY=:0.0 xset dpms force off should work. It will turn back on again if you touch it, hit a keyboard key or move a mouse.

Or you can use DISPLAY=:0.0 xset dpms force on to turn it back on again.

1 Like

Excellent!! My plan its to turn the display on via ssh when motion is detected, and then off again after a set time, all linked into Home Assistant for automation. :)


Hi, I’m coming late to this but the following command does not work for me:

DISPLAY=:0.0 xset dpms force off

I get the following error:

server does not have extension for dpms option
xset:  unknown option force

Any suggestions on how to fix this?

I didn’t manage to get this working, but I did find a neat way to control the backlight directly from python.

The rpi-backlight script (https://github.com/linusg/rpi-backlight) works really well for the Hyperpixel and allows python to turn the screen on and off.

You can see an example of this in use here: https://github.com/hankhank10/music-screen-api/blob/master/go_sonos_highres.py

For me I managed to do it with the following commands.

To turn the display off:

sudo echo 0 > /sys/class/backlight/backlight/brightness

To turn the display on:

sudo echo 1 > /sys/class/backlight/backlight/brightness