[Gllug] Getting the current VT

Mike Brodbelt mike at coruscant.demon.co.uk
Mon Apr 11 22:25:09 UTC 2005


>>That wasn't exaclt what I was thinking - I want something that tells me
>>vt7 is the current display if I'm under X at all. You can get the
>>information I'm from the kernel with the VT_GETSTATE ioctl, and it would
>>be easy enough to write a small C program to return it, but I was hoping
>>there was a pre-existing command that would do it.
> 
> 
> 
> Just curious, but why should you care? What are you trying to do exactly?

I have a laptop with an integrated video chipset for which the X driver
(version in Debian) has a bug. The result of this is that if the lid is
closed the screen blanks - when it's re-opened the video is restored
incorrectly. The lid open generates an ACPI event though, so I can tie a
script to that, and doing "chvt 1; chvt 7" cures the problem. I was
looking for a way to add some intelligence to the script, so that on lid
close the active VT gets written somewhere, and on re-open, if the
active VT had an X server attached, do the change - otherwise don't bother.

I've cribbed a small C program from a website that wraps the VT_GETSTATE
ioctl now, so I now have a small "getvt" program. Irritatingly, the
video driver is fixed in the X.org releases, but there's no sign of them
in Debian yet...

Mike.
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list