agama/live/live-root/root/.local/bin/gnome-kiosk-wrapper
Ladislav Slezák b98bb609f8
live: Added agama-screenshot helper script (#3537)
## Problem

- Taking screenshots of the Agama installer running locally is
difficult.

## Solution

- Added `agama-screenshot` helper script which saves the whole current
screen.

## Notes

- Enabling the unsafe mode in Gnome Kiosk should be fine in our case,
there is nothing else running in the machine besides the Agama
installer. And you need root access to communicate with the DBus session
bus.
- Ideally we should set some keyboard shortcut for that but
unfortunately Gnome Kiosk does not support that. 😟

## Testing

- Tested manually

```console
agama:~ # agama-screenshot
Screenshot saved to agama-2026-05-22-Pa5h.png
agama:~ # ll agama-2026-05-22-Pa5h.png
-rw-r--r-- 1 root root 112769 May 22 16:53 agama-2026-05-22-Pa5h.png
agama:~ # agama-screenshot agama.png
Screenshot saved to agama.png
agama:~ # ll agama.png 
-rw-r--r-- 1 root root 236302 May 22 16:53 agama.png

```

## Screenshots

Here are the screenshots taken by the commands above.

The default Agama screen after boot:
<img width="1280" height="800" alt="agama-2026-05-22-Pa5h"
src="https://github.com/user-attachments/assets/02e2d33b-07cf-42bf-b5a6-5a3708cc9858"
/>

It captures the whole currently visible screen, if you open the Firefox
developer tools then the window is captured as well:
<img width="1280" height="800" alt="agama"
src="https://github.com/user-attachments/assets/0f5ad823-71a4-4643-9939-4689bfcd0fea"
/>

---------

Co-authored-by: Martin Vidner <mvidner@suse.com>
2026-06-01 16:50:59 +02:00

19 lines
905 B
Bash
Executable file

#!/bin/sh
# Wrapper for starting gnome-kiosk itself (do not mess with gnome-kiosk-script).
# Only purpose of this script is to deal with various gnome-kiosk versions used
# in different products. This is intented to be called from systemd unit file
# see live/live-root/root/.config/systemd/user/org.gnome.Kiosk@wayland.service.d/override.conf
OPTS="";
# We need to invoke gnome-kiosk with option --enable-vt-switch for versions >= 50.
# Otherwise switching to virtual console will be blocked by default. bsc#1261932
if gnome-kiosk --help 2> /dev/null | grep -q 'enable-vt-switch'; then
OPTS="--enable-vt-switch";
fi;
# run in unsafe mode to allow taking screenshots (additionally it allows DBus
# introspection), as nothing else is running besides Agama and you need root
# permissions to talk to the DBus session then it actually is not that unsafe
exec /usr/bin/gnome-kiosk --unsafe-mode $OPTS