Skip to content

scripts: fold stg.sh into st.sh via a -d (display) flag#297

Merged
daniel-rossier merged 1 commit into
mainfrom
feat/st-display-flag
Jul 16, 2026
Merged

scripts: fold stg.sh into st.sh via a -d (display) flag#297
daniel-rossier merged 1 commit into
mainfrom
feat/st-display-flag

Conversation

@daniel-rossier

Copy link
Copy Markdown
Contributor

Summary

Merge the graphical launcher stg.sh into st.sh behind an optional -d (display) flag, so there is a single launch script.

  • st.sh (no flag) — headless as before: -display none, serial console only. Default for non-graphical work and CI.
  • st.sh -dgraphical: opens the QEMU GTK window (-display gtk,zoom-to-fit=off) presenting the guest PL111 CLCD (LVGL screen), and exports GDK_BACKEND=x11 / GDK_SCALE=1 / GDK_DPI_SCALE=1 so the so3,absmouse absolute pointer maps 1:1 onto the guest surface on fractionally-scaled HiDPI Wayland panels (harmless on native X11).
  • st.sh -h prints usage.

The script's own options are parsed out first; the remaining args are still forwarded to QEMU, so pass-throughs like st.sh -S (halt-for-GDB) keep working. Applies to both virt64 and virt32.

scripts/stg.sh is removed.

Docs & diagrams

Every stg.sh reference updated to st.sh -d:

  • doc/source/display_input.rst, lvgl.rst, user_guide.rst, build_system.rst
  • docker/scripts/run.sh guard message
  • Regenerated diagrams: gen_so3_diagrams.pyso3.drawio + so3_build.png / so3_io.png

Test

  • bash -n scripts/st.sh passes.
  • Option-parsing validated: no-arg → headless; -d → display on; -d -S and -S forward -S to QEMU; -h prints usage.

st.sh now takes an optional -d flag that opens the QEMU GTK window for the
guest PL111 CLCD (LVGL screen), replacing the separate stg.sh launcher.
Without -d the default stays headless (-display none, serial console only).

The flag switches the display backend to gtk,zoom-to-fit=off and, when set,
exports GDK_BACKEND=x11 / GDK_SCALE=1 / GDK_DPI_SCALE=1 so the so3,absmouse
absolute pointer maps 1:1 onto the guest surface on fractionally-scaled HiDPI
Wayland panels (harmless on native X11). Own options are parsed out before the
remaining args are forwarded to QEMU, so pass-throughs like -S still work.

stg.sh is removed; docs, the docker run.sh guard message and the generated
diagrams (gen_so3_diagrams.py + so3.drawio + PNGs) are updated to st.sh -d.
@daniel-rossier
daniel-rossier merged commit 963e36f into main Jul 16, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant