vtcurrent
Have you ever wanted to know programatically which virtual terminal is the
current one? You know, so that you can have lirc toggle between vt 7 (regular
X) and vt 8 (Freevo). I couldn’t figure out how to do this with available tools
so I dove in head first and figured out how to do it with ioctl().
http://hans.fugal.net/src/vtcurrent is the code including Makefile, and utility functions from console-tools.
vtcurrent.c is the meat,
vtswitch.sh is the end
result.