Search code examples
linuxbashxorgacpi

ACPI script , how to know about current TTY displaying to users?


I'm running a script in acpi , if current displayed virtual terminal , switch back to the terminal X11 is running ; else switch to tty1.

So the only problem is , how can i use a program to get the name of current displayed terminal ?

Any suggestions ? tty won't help , because it only get the terminal , that the it is running from , not the displaying one.

Many thanks !


Solution

  • I have to wonder why you need to do that, but you may need to write a program that uses the VT_* ioctl()s in console_ioctl(4).