免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8935 | 回复: 5
打印 上一主题 下一主题

如何关闭监视器 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-01 10:12 |只看该作者 |倒序浏览
Windows XP有一个关闭监视器的功能。                     
如下图:                                               

小弟想用Linux C写一个小程序来关闭监视器。              
但却不知从何着手。                                    
希望前辈们能指点方向。感激不尽^_^。

论坛徽章:
0
2 [报告]
发表于 2007-11-01 10:25 |只看该作者
什么都用C写,累不累啊!

  1. xset dpms force off
复制代码

论坛徽章:
0
3 [报告]
发表于 2007-11-01 10:37 |只看该作者
谢谢JohnBull版主的回覆。
不好意思,小弟忘了说我的系统是kernel 2.6.8+Busybox组合而成的。
系统并没有X Window。
所以无法使用xset dpms force off。

论坛徽章:
0
4 [报告]
发表于 2007-11-01 10:43 |只看该作者
那就不知道了。

查查frame buffer的手册,查查你的显卡驱动的手册......

论坛徽章:
0
5 [报告]
发表于 2007-11-01 16:05 |只看该作者
小弟后来找到setterm,用man看它的说明如下:                             
                                                                       
-blank [0-60] (virtual consoles only)                                 
       Sets the interval of inactivity, in  minutes,  after  which  the
       screen  will  be automatically blanked (using APM if available).
       Without an argument, defaults to 0 (disable console blanking).  
                                                                       
-powersave on|vsync                                                   
       Puts the monitor into VESA vsync suspend mode.                  
                                                                       
-powersave hsync                                                      
       Puts the monitor into VESA hsync suspend mode.                  
                                                                       
-powersave powerdown                                                   
       Puts the monitor into VESA powerdown mode.                     
                                                                       
-powersave [off]                                                      
       Turns off monitor VESA powersaving features.                    
                                                                       
-powerdown [0-60]                                                      
       Sets the VESA powerdown interval in minutes.  Without  an  argu-
       ment,  defaults  to  0  (disable  powerdown).  If the console is
       blanked or the monitor is in suspend mode, then the monitor will
       go  into vsync suspend mode or powerdown mode respectively after
       this period of time has elapsed.                                
                                                                       
使用后发现setterm -blank 1有作用。                                    
但它只是把监视器关闭,并没有把监视器的电源关闭。                       
而设定了-powersave on,-powerdown 1一样没有把监视器的电源关闭。              
                                                                       
小弟程度不是很好,只好再请前辈们帮忙了。谢谢。

论坛徽章:
0
6 [报告]
发表于 2007-11-05 17:41 |只看该作者
小弟在google找了数天,
只找到Windows关闭监视器电源是用SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) -1);
但Linux在没有X Window的情况下到底该如何关闭监视器电源?
小弟还是一无所知。
再次拜托高手相助了。万分感激。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP