I'm looking for a scripted way to check if the external monitor is on and connected.
My Ubuntu laptop often fails to turn on the external monitor after sleep or a blank screen. I've long since solved the problem using xset dpms force on; xset dpms force off;
.
This solution is less than perfect because the monitor goes through a cycle of black screen / blue screen, and the xset
operation must be executed while the monitor is in the black screen state. I often repeat the command multiple times until it works.
If I could check if the monitor is properly connected I could better automate the script that re-engages the monitor using xset dpms force on|off
.