sudo vi /etc/lightdm/lightdm.conf
取消其中的注释
#xserver-command=X
并修改为
xserver-command=X -s 0 -dpms
-s # –设置屏幕保护不启用dpms 关闭电源节能管理重启树莓派
sudo reboot