Linux设置屏幕不熄灭
通过xorg.conf方式设置屏幕不熄灭屏幕,尤其是对需要开机自动全屏化运行自己编写的Qt桌面程序时,可以保证Qt界面程序,运行时,屏幕常亮
建立xorg.conf
文件,内容如下
Section "Device"
Identifier "Configured Video Device"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
HorizSync 30.0-62.0
VertRefresh 50.0-70.0
EndSection
#屏幕熄屏设置,设置屏幕常亮,此段代码用来设置屏幕常亮
Section "ServerFlags"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection
#其它设置:分辨率设置
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768"
EndSubSection
EndSection
将xorg.conf
拷贝到/etc/X11/
目录下,赋予可执行权限
chmod +x xorg.conf