Static Display Configuration for Mir

Background

We have encountered a number of scenarios where users need to explicitly set the arrangement of displays on a Mir server. The motivation for this work comes from scenarios like arranging a “display wall” for signage, but I’m sure uses could also be found on the desktop.

The file format

We explored a number of options but settled on YAML. This is widely used within Canonical products and will be familiar to anyone creating snaps. Here’s an example file from my testing:

Then, having made sure you have first signed into VT4 you run miral-desktop saying that you want to use a static display layout:

miral-desktop --display-config static=static-display-layout

Here static-display-layout is just the name of a file we intend to use. The name doesn’t matter, but ensure the file doesn’t yet exist (otherwise Mir will try to use it). Exit Mir and look back at the console log, you should see something like the following:

Cut & paste the bits between the 8>< --------------------------------------------------- lines into a new file “static-display-layout”. This gives you a template (without any options selected) corresponding to your available displays.

You can then experiment with changing the mode, position and orientation of your display outputs and re-running with the same command used above. This time it will read the file and apply the options you’ve selected.