Хорошо, проверил исходный код xset .Соответствующие части кода:
#include <X11/extensions/dpms.h>
...
Display* dpy = XOpenDisplay(NULL);
...
int dummy;
CARD16 standby, suspend, off;
BOOL onoff;
CARD16 state;
printf("DPMS (Energy Star):\n");
if (DPMSQueryExtension(dpy, &dummy, &dummy))
{
if (DPMSCapable(dpy))
{
DPMSGetTimeouts(dpy, &standby, &suspend, &off);
printf (" Standby: %d Suspend: %d Off: %d\n",
standby, suspend, off);
DPMSInfo(dpy, &state, &onoff);
if (onoff)
{
printf(" DPMS is Enabled\n");
switch (state)
{
case DPMSModeOn:
printf(" Monitor is On\n");
break;
case DPMSModeStandby:
printf(" Monitor is in Standby\n");
break;
case DPMSModeSuspend:
printf(" Monitor is in Suspend\n");
break;
case DPMSModeOff:
printf(" Monitor is Off\n");
break;
default:
printf(" Unrecognized response from server\n");
}
}
}
}
На всякий случай, если кому-то еще это нужно;