前題:
因為,在我的Ubuntu下.雖然有選項可以鎖往螢幕.但其螢幕只是全黑.而非關閉螢幕.
前陣子,找到一篇在講在X下設定的文章.目前會先關閉螢幕,再由系統來進入鎖住的動作
在X中提供了二個方法來實作screen blanking: blanktime 及 dpms.其設定均由 xset -q
因為,在我的Ubuntu下.雖然有選項可以鎖往螢幕.但其螢幕只是全黑.而非關閉螢幕.
前陣子,找到一篇在講在X下設定的文章.目前會先關閉螢幕,再由系統來進入鎖住的動作
在X中提供了二個方法來實作screen blanking: blanktime 及 dpms.其設定均由 xset -q
- blanktime是一個"假"的screen blanking:它使其螢幕black,但其backlight及power是在stay on 狀態中.它不能真正地減少功率的消耗.只是像是一個沒有的螢幕保穫. 在最新版的Xorg中,其blanktime已移除由Screen Saver替代之.其中screen saver中包含了許多選項像是prefer blanking,allow exposures,timeout及cycle.它與blanktime的工作也不同,像是prefer blanking中是真正地將螢幕切換到powersave mode 但且在prefer blanking中也不允計進入"fake blank"
- DPMS是一個display power management.它只工作於其display,它支援具有其power management中.而DPMS中可以由下列3個設定
在CRT時,它會關閉電子槍,但其它的功能仍然動作.故其screen可以快速地回復.
Supspend time:
它不只把電子槍關閉,連同monitior power也一同關閉off time:
這時,會關閉所有螢幕的電源.
The Timeouts
其timeout時間是從何處來? 其default值已存在已X中,而且在X中並非可見的.故你可能找不到的.你可由xset來設定, "設定blank timeout"
xset s blank xset s 300設定其為300秒(five minutes).
xset dpms 0 360 420由dpms設定,關閉standby time狀態;其suspend time為360秒及off time為420秒.
In theory, this combined with the previous xset commands would first blank the screen at five minutes;
若依照上面的指令,其display會在300s進入blank ;然後在360秒後進入suspend狀態;420秒後又改變.但實際上,它不會依此動作.(只會進入screen-blanked state)
-------------------------------------
But the timeouts can also be specified in the X configuration file: /etc/X11/xorg.conf. In the "Monitor" section, you need a line like:
Option "DPMS"Then, in the "ServerLayout" section (for Xorg 7.2 and later, make a separate ServerFlags section instead), include lines like this:
Option "BlankTime" "4"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "5"
Caution: note the numbers are all small. xorg.conf needs times specified in minutes, not seconds as with xset.Caution: note the numbers are all small. xorg.conf needs times specified in minutes, not seconds as with xset.
If you're seeing a timeout that isn't one of the defaults, but isn't specified in xorg.conf -- as with the two-minute timeout which set me on this quest in the first place -- you may have to hunt around for a place that's calling xset dpms with a different set of timeouts. In my case, it turned out that Ubuntu Breezy sets the dpms timeouts in /etc/acpi/power.sh, which gets called at boot time. So anything you set in xorg.conf may well get overridden.
---------------------------------- 不知在可處設定之.?
Testing the monitor blanking modes
想要去看各種選項下的結果? 可以使用xset來試.sleep 1; xset s activate. You need the delay because X gets a little confused about the order of events; it will blank the screen but immediate un-blank it, thinking the activity of your typing the command happened recently enough to come out of screensaver mode.
會在一秒後,blank the screen ;在此你必須delay some time ,因為其 X會對其event的順序產生confused;它會立即blank screen後,即刻回復.
sleep 1; xset dpms force off
這個則為在一秒後 turn the screen OFF.你也可以用 standby ,suspend,on來替代 off.
Oops! It doesn't work!
先將遊標移動到 螢幕的動作品的外面,再下 sleep 1; xset dpms force off.你的screenturn off 沒? 全部?沒有backlight?若有,即O.K了;反之則,依下步驟
其實,在大多的系統中.DPMS並沒有真正的被執行.只是一個名稱而已.而xset dpms force off只是使screen black而已,而其backlight stays on.
當然,你必須先去懷疑硬体並不支援DPMS.而如何去測試呢?
Testing, redux
.幸運地,有一個容易的方式:vbetool. 這個就是ubunts's sleep.h中來turn the monitor off when suspending.
證明backlight,是否 turn off : vbetool dpms off
If the backlight turns off, the problem isn't the hardware: it's just that Xorg, for reasons unknown, isn't really using DPMS when it says it will. A little googling showed dozens of people reporting this on video cards from at least four different manufacturers, so it's not an isolated occurrence. Nobody seems to have an explanation or a cure. Some people say that eventually the backlight does turn off, but with a delay much much longer than the one that's set (e.g. they set the off timeout to 10 minutes, and their screen blanks at 10 minutes, then the backlight finally turns off at 30 minutes or an hour). That's not really very useful, and it doesn't even happen on all machines. On my laptop, even that doesn't seem to happen; the backlight stays on for as long as I've tested it.
沒有留言:
張貼留言