Setup: Ubuntu, Openbox, notebook, occasionally an external screen.
I’ve set things up so that if an external monitor is attached when I start my notebook, a script (run by Openbox’s autostart), xrandr makes that the primary monitor.
What I’d like to do is run that script when I turn off or otherwise disconnect that external monitor, so that I can make the notebook’s built-in screen the primary again. Does anyone here have any ideas how to do that automatically?
oh dear. I just found autorandr which might be what you’re looking for and probably a fair bit easier than what I suggested initially.