I'm polling using xrandr to check whether a new display was plugged in, so I can run a script to switch to it, i.e. plug in an external VGA monitor and it lights up automatically, unplug it and my laptop automatically switches back to using its internal display. But, every time I run xrandr my (USB connected) audio stutters, which makes me sad because I was hoping to poll for a new display every 5 seconds, but that's not so great while listening to music.
Does anyone know of a better way to notice a newly plugged in display...perhaps one that's more passive/efficient so as not to provoke stuttering audio? I don't see any output from hotplugd that I could use unfortunately, that seemed like the right place to look first. I didn't notice anything I could use in the Xorg log either.