Linux不让显示器休眠方法:
# setterm -blank 0
# setterm -blank n (n为等待时间)
也可以编辑xorg.conf,添加如下选项把xscreen saver直接关闭:
Section “ServerFlags”
Option “BlankTime” “0″ #关闭黑屏
Option “StandbyTime” “0″ #关闭待机功能
Option “SuspendTime” “0″ #关闭睡眠功能
Option “OffTime” “0″
EndSection
修改后重启x即可生效。
编辑xorg.conf文件和使用xset命令效果一样,可使用xset -q查看设置和当前配置。
备注:
时间值设置成0 就是关闭该项.
# xset -q //查看设置和当前配置
# xset -dpms //Energy Star features off
# xset +dpms //Energy Star features on
[root@hsgpc xorg.conf.d]# xset -h
xset: unknown option -h
usage: xset [-display host:dpy] option ...
To turn bell off:
-b b off b 0
To set bell volume, pitch and duration:
b [vol [pitch [dur]]] b on
To disable bug compatibility mode:
-bc
To enable bug compatibility mode:
bc
To turn keyclick off:
-c c off c 0
To set keyclick volume:
c [0-100] c on
To control Energy Star (DPMS) features:
-dpms Energy Star features off
+dpms Energy Star features on
dpms [standby [suspend [off]]]
force standby
force suspend
force off
force on
(also implicitly enables DPMS features)
a timeout value of zero disables the mode
To set the font path:
fp= path[,path...]
To restore the default font path:
fp default
To have the server reread font databases:
fp rehash
To remove elements from font path:
-fp path[,path...] fp- path[,path...]
To prepend or append elements to font path:
+fp path[,path...] fp+ path[,path...]
To set LED states off or on:
-led [1-32] led off
led [1-32] led on
-led named 'name' led off
led named 'name' led on
To set mouse acceleration and threshold:
m [acc_mult[/acc_div] [thr]] m default
To set pixel colors:
p pixel_value color_name
To turn auto-repeat off or on:
-r [keycode] r off
r [keycode] r on
r rate [delay [rate]]
For screen-saver control:
s [timeout [cycle]] s default s on
s blank s noblank s off
s expose s noexpose
s activate s reset
For status information: q
[root@hsgpc xorg.conf.d]# xset -dpms //close Energy Star =off
[root@hsgpc xorg.conf.d]# xset +dpms //Open Energy Star =on
禁止 centos 休眠
linux由于屏幕关闭加上长时间没有操作可能导致centos进行深度休眠,此时只能通过电源键来强制重启。
可以通过修改X11的配置来禁止休眠,配置文件为/etc/X11/xorg.conf,
注意修改此文件前记得备份,防止由于配置错误导致无法进行X11桌面。
修改涉及两个地方,第一个是 Section “Monitor”,查看其配置中是否有 DPMS,且其值为 false,保证配置信息如下:
Option "DPMS" "false"
第二个修改是增加一个 Section “ServerFlags”,包含的内容如下:
Section "ServerFlags"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection