[Gllug] Getting the current VT
Christian Smith
csmith at micromuse.com
Mon Apr 11 14:43:48 UTC 2005
On Sun, 10 Apr 2005, Mike Brodbelt wrote:
>On Sun, 2005-04-10 at 00:23 +0100, Benedikt Heinen wrote:
>> > Very quick question - does anyone know how to get the value of the
>> > current virtual terminal from a script?
>>
>> Like this?
>>
>>
>> --> in a shell window under X11:
>>
>> beh at berenium:~ $ tty
>> /dev/pts/5
>> beh at berenium:~ $
>>
>> --> in a virtual console:
>>
>> beh at berenium:~ $ tty
>> /dev/tty3
>> beh at berenium:~ $
>
>
>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?
>
>Mike.
>
Christian
--
/"\
\ / ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
X - AGAINST MS ATTACHMENTS
/ \
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list