[Gllug] Getting the current VT
Mike Brodbelt
mike at coruscant.demon.co.uk
Sun Apr 10 00:05:14 UTC 2005
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.
Mike.
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list