Set screen to sleepenvironmentIdea 1 (recommended)Graphical interfaceCommand LineRestartIdea 2Configuration file modificationRestart
The tutorial mainly introduces how to set the screen to always be on. If the screen is turned on on the Raspberry Pi system, the default is to automatically turn off the screen after 10 minutes of no operation.
System: Raspberry Pi OS
Raspbian is the old name of Raspberry Pi's official Debian-based operating system, and Raspberry Pi OS is its new name after its name change in 2020.
Turn on automatic screen break: applications menu → Preferences → Raspberry Pi Configuration
Display → Screen Blanking: Turn on (if you need to turn off the screen blanking, just turn off the switch)
Use the raspi-config tool to automatically blank the screen: Display Options → Screen Blanking: enable
The modified configuration will take effect after restarting!
You can configure the lightdm desktop display manager to use xservice to keep the screen always on.
lightdm.conf file location:/etc/lightdm
xxxxxxxxxx
sudo nano /etc/lightdm/lightdm.conf
Cancel the comment character # of xserver-command=X in the file and change it to xserver-command=X -s 0-dpms. After the modification is completed.
xxxxxxxxxx
The nano editor can use the shortcut key Ctrl+W to search for keywords!
Save and exit the nano editor: press Ctrl+X, enter y, and press Enter.
xxxxxxxxxx
Among them, -s parameter: set the screen saver not to start, 0 is the number zero, -dpms parameter: turn off power and energy-saving management.
Enter the reboot command in the terminal to restart the system, and the modified configuration file will take effect after restarting!