Ignoring hotplug monitor events on Arch Linux

Automatic hotplug event handling can be a problem, eg. when its run for monitors. I use HDMI splitter between my host OS and gaming VM and I didn’t like that my windows were all over the place when I’ve used it.

There are few ways to disable those (but still to be able to run them manually when needed!), but I’ve found only one method is able to run for all GPU drivers.

Most obvious method is xorg setting “UseHotplugEvents”. It’s great, but works only for Nvidia binary driver.

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "BenQ G2450"
HorizSync 30.0 - 83.0
VertRefresh 50.0 - 76.0
Option "UseHotplugEvents" "False"
EndSection

There is also similar setting but in this case, for Intel driver only.

Aside of both of that, there may be need to disable automatic xrandr events in your DE.
Cinnamon:
gsettings set org.cinnamon.settings-daemon.plugins.xrandr active false
Gnome:
gsettings set org.gnome.settings-daemon.plugins.xrandr active false

About this independent one (I use it with Nouveau) – option is to disable udev completely (for a while). That means that it also won’t work for dynamic USB devices, etc. But it’s good enough if you need to disable monitor discovery for a moment and can turn it on later again.

sudo udevadm control --stop

sudo udevadm control --start

Leave a Reply

Your email address will not be published. Required fields are marked *