On Mon, 28 Jan 2008, Jim Paris wrote:
> > You will need acpi handlers, yes.  I wish I knew how to ask the kernel "is
> > the current VT a text console, or a X video port?", but I have
> > no idea how to do that.
> 
> >From userspace, I think this does the trick:
> 
>    #include <linux/kd.h>
>    int fd, arg;
>    fd = open("/dev/console", O_NOCTTY);
>    ioctl(fd, KDGETMODE, &arg);
>    if (arg == KD_GRAPHICS)
>       printf("X");
>    else
>       printf("text");

Thanks :-)

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
ibm-acpi-devel mailing list
ibm-acpi-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel

Reply via email to