I have a laptop that's normally docked to a large monitor. When docked, I want to use the large monitor as the primary display, with the laptop screen as a secondary display off to the right. When undocked, the laptop screen is the only display.
XFCE doesn't seem to have that kind of multi-monitor support built in. I found ARandR, which let me set up my monitors the way I want. I can use ARandR to save profiles for docked and undocked configurations (which are really just shell scripts that invoke xrandr).
But how do I get those profiles to apply automatically when the laptop is docked and undocked? Should I try to create a udev rule that detects the docking station? Is there a better way?