Raspberry Pi 4 - Screen Blanking manually via command line 2023

From ETCwiki
Revision as of 18:34, 18 January 2023 by Ddxfish (talk | contribs)
Jump to navigationJump to search

This would go in a crontab or can be manually run via the command line. I wanted my rpi screen to power off at night, then be on all day. Most guides seemed confusing, and raspi-config didn't seem to do what I wanted.

Enable screen blanking on rpi4 so screen will automatically sleep after a while

export DISPLAY=:0; xset +dpms; xset s blank; xset s off; xset dpms force on

Disable screen blanking so screen is always on

export DISPLAY=:0;xset s noblank; xset s off; xset -dpms

Description of xset settings on raspberry pi

  • xset s noblank
    • Sets the screen to not blank
  • xset s off
    • Sets the screensaver off (if applicable)
  • xset -dpms
    • Turns off Display Power Management (dpms won't trigger the screen to sleep)
  • xset +dpms
    • This forces Display Power Management to kick in and sleep the monitor after a while
  • xset dpms force on
    • (not sure) I think this is +dpms but also forces the monitor to turn on.

Troubleshooting

Allow 15 minutes with each setting to see if it's what you want. export DISPLAY=:0 is only needed if you run it via crontab or SSH. There may be other things that blank your screen, like system settings in MATE or other DE's, so look there too.