0

Is there a way that we can find the status of a display monitor in a linux environment? pointers on any standard C libraries / unix calls would be helpful. I got many interesting articles on how this can be achieved on win32, but none of them would point a solution for a linux environment.

i tried using xrandr, but it fails to detect the status dynamically

any pointers??

  • This may help you: The protocol and tools are called DPMS (Display Power Management Signaling). You also will need to specify what environment you're using. For example, there are different tools under X versus under the console. – Dark Falcon Oct 19 '11 at 18:39
  • @DarkFalcon i am using an open suse 10.3 version environment. let me check further on the dpms tools meanwhile – user1003782 Oct 19 '11 at 19:36

1 Answers1

0

Here is a simple program using Linux Real Mode Interface:

#include "lrmi.h"

int main(void)
{
   struct LRMI_regs r = {0};
   r.eax = 0x4F10;
   r.ebx = 0x02;

   ioperm( 0, 1024, 1 );
   iopl( 3 );

   if( !LRMI_init() || !LRMI_int( 0x10, &r ) )
   {
      return -1;
   }
   return (r.ebx >> 8) & 0xFF;
}

Some possible return values: 0 (on), 1 (standby), 2 (suspend), 4 (off), 8 (reduced on).

isotherm
  • 36
  • 2