/etc/acpi/ there are several scripts that can be customized to do something when a particular event happens on your physical computer, like the
lid.sh script which is called when the laptop lid is opened or closed, but I'm looking for a way to detect when something is plugged into or disconnected from the Mini DisplayPort, so that I can run a command.
I don't see any such script in there (unless I've missed something).
The command would be to configure the multi-monitor setup automatically using
xrandr. This used to happen automatically in Gnome (using
~/.config/monitors.xml I believe) but I've now switched to
xmonad completely and it doesn't automatically detect this.