I am working around a problem in Ubuntu 10.04 where after resume, the mouse cursor disappears.
This can be "fixed" by running chvt 1; chvt 7
in a script in /etc/pm/sleep.d, such that those commands run on thaw and resume.
However, the X console is not always vt #7, so chvt 7
is wrong in those cases.
What I would like to do is find out the current vt in the fix-up script and make sure I change back to that vt.
How can I find the current vt? (tty(1) just reports "not a tty")
Check if 'fgconsole' does what you need. Seems to work for me (eg, returns 7 and I'm currently in X)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With