Set screen sleepEnvironmentIdea 1 (recommended)Graphical interfaceCommand lineRebootIdea 2Configuration file modificationReboot
The tutorial mainly introduces how to set the screen to stay on. If the Raspberry Pi system has the screen off turned on, 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 the official operating system of Raspberry Pi based on the Debian system, and Raspberry Pi OS is its new name after the name change in 2020.
Turn on automatic screen blanking: applications menu → Preferences → Raspberry Pi Configuration
Display → Screen Blanking: Enable (if you need to turn off the screen blanking, just turn off the switch)
Use raspi-config tool to automatically blank the screen: Display Options → Screen Blanking: enable
The modified configuration takes effect after reboot!
You can use xservice to configure the lightdm desktop display manager to achieve the purpose of keeping the screen on.
lightdm.conf file location: /etc/lightdm
xxxxxxxxxx
sudo nano /etc/lightdm/lightdm.conf
Uncomment the # in the file xserver-command=X 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 then press Enter.
xxxxxxxxxx
Among them, the -s parameter: set the screen saver not to start, 0 is the number zero, and the -dpms parameter: turn off power saving management.
Enter the reboot command in the terminal to restart the system, and the modified configuration file will take effect after restart!