I have the following use-case: My Raspberry Pi based gadget has no direct input methods attached and is running mir-kiosk in fullscreen. My snap provides a web GUI to manage the device, which should also allow to change the screen rotation (a.k.a. display layout in mir-kiosk speak). I use cloud.conf with ubuntu-image to write out the required layouts.
mir-kiosk provides a configure hook to change the selected display layout. Is there any mechanism which would allow me to call mir-kiosk's configure hook from within my snap? I do realize the security implications, which is why I looked at the interfaces documentation – but there doesn’t seem to be a “allow configure hook calls from the connected snaps” interface
Provided I come up with an interface-based solution to call a script that mirrors mir-kiosk's configure hook and it gets accepted by the mir-kiosk maintainers : Which would be preferable, D-Bus or a simple shell script through the content interface?
Control of the display configuration used to be available to authorized clients of the (now obsolete) mirclient API. That’s one of the features that has been temporarily “lost” in transition to Wayland.
I do agree that the current facilities leave something to be desired, but my preferred approach would be to use a Wayland extension that can be hooked into the Mir code that supported the mirclient API.
Between “D-Bus or a simple shell script through the content interface” I don’t see what would activate a shell script. I can imagine a daemon that responds to dbus calls by using snapctl set to change configuration options. That’s likely the simplest thing that could work.
I am also in situation where my single app wants to rotate mir’s display,
instead of doing this manualy (from shell)
I think I could hardcode this in gadget or extra cloud configuration,
which method do you recommend for uc20 ?
While the issue was actually never solved, Mir has the ability to read config files nowadays … through a gadget.yaml enty you could feed nested yaml into that to have it come up rotated with the display-config: option…
My original question (and maybe also @rzr) was on-demand rotation, so that a user can freely rotate the display later on if they chose to do so, without having to connect to the device via SSH (no local keyboard and disabled terminal).
@alan_g Is there any such extension available that could be used for this purpose?
you could do it with a snap that has the snapd-control interface connected to allow you the REST API access to call the equivalent of:
snap set mir-kiosk display-layout=inverted
(like described in the masterclass doc i linked)
which i believe applies the new config and restarts mir (which indeed requires the differnt configs you want to switch between to be set up in advance)…
and indeed snapd-control requires a brand store … but it is surely possible even today
Ah yes, forgot to mention: We don’t have a brand store (yet) If that’s the case, then seeding the config via gadget + snapd-control's possibilities would be the way to go. Unfortunately, prospective customers require functionality like display rotation before they buy into a contract, which we would require to pay for the brand store that enables it (not a complaint)