Is there some command (or trick) to detect what DISPLAY is active?
I mean active in a sense that it will "eat" all key strokes, and mouse clicks and moves; so it has the input focus.
I mean also for the simple hardware installation where the user has only one physical keyboard and only one mouse (usb or ps2).
The default X session loads at ctrl+alt+f7 (:0) here.
I have another X at ctrl+alt+f8/f9 (:1).
I want to code a script that, when I go to :1, it automatically lock :0, or :1 accordingly.
When the mouse is stopped and no key is being pressed, we are just staring at the screen; but, I think the "current active? (or both are?)" X must be watching the input for changes, while the other X is unable to watch such changes, that channel must be uniquely accessed in some way... any tips?