DPMS
跳转到导航
跳转到搜索
编程
#include<stdio.h>
#include<X11/Xlib.h>
#include<X11/extensions/dpms.h>
int main(int argc, char **argv){
Display *dpy = XOpenDisplay(NULL);
unsigned short standby, suspend, off;
Bool ret;
/* 设置 DPMS 超时时间,单位:秒,默认为 600 */
DPMSSetTimeouts(dpy, 600, 600, 600);
/* 获取 DPMS 超时时间 */
ret = DPMSGetTimeouts(dpy, &standby, &suspend, &off);
if(ret){
printf("%hu %hu %hu\n", standby, suspend, off);
}
return 0;
}
链接库: -lXext