Continuing the work on display configuration I described last week this is how I envisage it working for mir-kiosk
. This functionality is on Mir “master” and available with the mir-kiosk
“edge” channel. Note that this functionality has not been released yet (and may change before release).
When started mir-kiosk
looks for a file: /var/snap/mir-kiosk/common/miral-kiosk.display
this is expected to describe the required display layout.
The format of the file is like this:
layouts:
# keys here are layout labels (used for atomically switching between them)
# when enabling displays, surfaces should be matched in reverse recency order
default: # the default layout
cards:
# a list of cards (currently matched by card-id)
- card-id: 0
VGA-1:
# This output supports the following modes: 1920x1080@60.0, 1680x1050@60.0,
# 1280x1024@75.0, 1280x1024@60.0, 1440x900@59.9, 1280x960@60.0, 1280x800@59.8,
# 1152x864@75.0, 1280x720@60.0, 1024x768@75.0, 1024x768@70.1, 1024x768@60.0,
# 832x624@74.5, 800x600@75.0, 800x600@72.2, 800x600@60.3, 800x600@56.2,
# 640x480@75.0, 640x480@66.7, 640x480@59.9, 720x400@70.1
#
# Uncomment the following to enforce the selected configuration.
# Or amend as desired.
#
# state: enabled # {enabled, disabled}, defaults to enabled
# mode: 1920x1080@60.0 # Defaults to preferred mode
# position: [0, 0] # Defaults to [0, 0]
# orientation: normal # {normal, left, right, inverted}, defaults to normal
HDMI-A-1:
# This output supports the following modes: 1920x1080@60.0, 1680x1050@59.9,
# 1280x1024@75.0, 1280x1024@60.0, 1440x900@59.9, 1280x960@60.0, 1280x800@59.9,
# 1152x864@75.0, 1280x720@60.0, 1024x768@75.0, 1024x768@70.1, 1024x768@60.0,
# 832x624@74.5, 800x600@75.0, 800x600@72.2, 800x600@60.3, 800x600@56.2,
# 640x480@75.0, 640x480@66.7, 640x480@59.9, 720x400@70.1
#
# Uncomment the following to enforce the selected configuration.
# Or amend as desired.
#
# state: enabled # {enabled, disabled}, defaults to enabled
# mode: 1920x1080@60.0 # Defaults to preferred mode
# position: [0, 0] # Defaults to [0, 0]
# orientation: normal # {normal, left, right, inverted}, defaults to normal
DisplayPort-1:
# (disconnected)
HDMI-A-2:
# (disconnected)
DisplayPort-2:
# (disconnected)
If the file doesn’t exist already, mir-kiosk
will create a template file that reflects the current hardware. When you look at the template display configuration file, you’ll see that all the options are commented out (as in the above example). Just activate and change the ones that you need (you’ll need sudo to update to this file).