When I plug my laptop into its dock thingy, there's some kind of race condition that makes the monitors get assigned their randr names DP-1 and DP-2 in random order. Which means if I save my randr layout they're sometimes the wrong way around.
This script is a quick and dirty hack workaround that figures out which is which based on their serial number (EDID).
Probably also useful if you have one multi-monitor randr arrangement at home and a different one at work.
https://gist.github.com/datagrok/410d26e24ec51159cdfd2a400b809705