> What I was thinking is that the original position of monitor 0 could be > recorded before the sorting, then shift / rotate the sorted list so that > the primary screen remains where it were originally, e.g. > > [0][1][2][3] --> shift once > [3][0][1][2] > ^_primary
But that way the screens in dwm end up in an order other than the actual, "physical" order. That means that the monitor numbering given in rules[] does not correspond to the actual positioning of the screen in the real (or xrandr) world. To me the current approach in retaining screen order within dwm feels more intuitive. I think to solve the "primary screen issue" you'd have to introduce the concept of a primary screen to dwm. Something like the following should work well enough: Start screen numbering in rules[] with 1 instead of 0 and make 0 a special monitor index that always points to the primary screen no matter its physical location. -- Sebastian