Upon connecting or disconnecting an external monitor via HDMI (other video connections could be followup work), we should call xrandr to update. Ideally we'd have configurations for each monitor we use, so the call to xrandr simply works.
Detecting HDMI seems like it can be done from /sys/class/drm/card0/*HDMI*/status, read this SO post for more information on this approach.
Upon connecting or disconnecting an external monitor via HDMI (other video connections could be followup work), we should call
xrandr
to update. Ideally we'd have configurations for each monitor we use, so the call toxrandr
simply works.Detecting HDMI seems like it can be done from
/sys/class/drm/card0/*HDMI*/status
, read this SO post for more information on this approach.