I'm writing a script in which I need to switch between two displays, but I can't find a way to get the information about the current active output.
Pretty much like this:
if Display0 is off and Display1 is on
turn off Display1
turn on Display0
else if Display1 is off and Display0 is on
turn off Display0
turn on Display1
The piece I'm missing is the first line: how do I know which display is currently active?
Note: xrandr -q doesn't help because it always print that both displays are "connected" regardless of whether the output is directed on Display0 or Display1, not sure if this is a bug.