I use a laptop running ubuntu 20.04.
I usually have an additional display connected to the laptop, extending the monitor between the two of them. But I would like that, when I close the laptop lid, it would reconfigure the layout to not extend to the laptop and use only the external display, in the same way that disconnecting the external display pushes everything to the laptop.
Is that possible?
sudo evtest
or similar to list the input event devices to see if one is the lid switch, then you might be able to listen to events from it and run xrandr to reconfigure your screens. – meuh Jul 02 '20 at 15:12