diff options
| author | user <user@clank> | 2026-09-22 16:00:10 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-09-22 16:00:10 +0200 |
| commit | b8e931b548e5e71fd001b9b5e9bbfce8574c7bb6 (patch) | |
| tree | 631e76b847dcfc21a4d363a3c96612cb6e9618a1 /web | |
| parent | web: a recording of the theme picker, and the tour step for it (diff) | |
| download | slosh-b8e931b548e5e71fd001b9b5e9bbfce8574c7bb6.tar.gz slosh-b8e931b548e5e71fd001b9b5e9bbfce8574c7bb6.tar.xz slosh-b8e931b548e5e71fd001b9b5e9bbfce8574c7bb6.zip | |
webdemo: the picker in the machine, and a guest that proves its themes
The demo image was cut before any of this existed: an old guest binary with
no `C-a t` in it, and a config whose theme was a pasted palette. Rebuilt --
guest binary, root filesystem, site -- so the thing a visitor lands in is the
thing the front page is now claiming.
The overlay already kept every shipped theme in ~/.config/slosh/themes (they
are symlinks into contrib/, copied by content because a symlink in an ext2
image would dangle), which turns out to be exactly the directory the picker
looks in first -- and in the guest it is the *only* one, since /usr/bin/slosh
has no share/slosh beside it. So `boot-check` now asks the guest itself:
`{"cmd":"theme"}` over --script, expecting the worn theme and the shipped list
back. It failed honestly the first time, for the right reason (no HOME in a
phase that boots straight to /bin/sh, so no config, so no themes/ beside it),
which is the kind of failure a check is for.
The welcome float grew a fourth line -- `C-a t`, every theme, worn as you
browse -- and a row to hold it; the motd and the config's own comments say the
same. A visitor who reads three lines and presses one key should land on the
feature the page just sold them.
Diffstat (limited to 'web')
| -rw-r--r-- | web/demo/README.md | 13 | ||||
| -rwxr-xr-x | web/demo/boot-check | 14 | ||||
| -rw-r--r-- | web/demo/overlay/etc/motd | 2 | ||||
| -rw-r--r-- | web/demo/overlay/etc/welcome | 3 | ||||
| -rw-r--r-- | web/demo/overlay/root/.config/slosh/config.kdl | 5 | ||||
| -rw-r--r-- | web/demo/overlay/root/demo.layout | 5 |
6 files changed, 33 insertions, 9 deletions
diff --git a/web/demo/README.md b/web/demo/README.md index 8e3502f..5b4ca1f 100644 --- a/web/demo/README.md +++ b/web/demo/README.md @@ -128,13 +128,18 @@ which is the whole of what makes it ours: | `etc/init.d/rcS` | mounts, and `devpts` in particular: no devpts, no panes | | `etc/profile` | the environment every pane inherits, `COLORTERM` included | | `etc/motd` | five lines, shown in a pane rather than on the console | -| `root/.config/slosh/config.kdl` | the demo's config: the `sl0p` theme | +| `root/.config/slosh/config.kdl` | the demo's config: `theme_name "sl0p"`, and the knobs worth uncommenting | +| `root/.config/slosh/themes/` | every theme the repository ships, so `C-a t` has a list to offer | | `root/.vimrc` | syntax on, truecolor, and nothing that wants the pruned parts | | `root/demo.layout` | the three panes you land in | -The theme is a symlink to `contrib/themes/sl0p.kdl`, so the demo cannot drift -from the palette the repository ships; `build-rootfs` copies it by content, -because a symlink in the image would dangle. +The themes are symlinks into `contrib/themes/`, so the demo cannot drift from +the palettes the repository ships; `build-rootfs` copies them by content, +because a symlink in the image would dangle. They live where a person's own +would (`~/.config/slosh/themes`), which is also the directory `theme_name` and +the `C-a t` picker look in first -- the guest binary sits in `/usr/bin` with no +`share/slosh` beside it, so that directory is the whole list, and `boot-check` +asks the guest for it rather than trusting that. Editing anything in `overlay/` and running `make` rebuilds the image. There is no state to clear: the emulator's writes live in the browser's memory and die diff --git a/web/demo/boot-check b/web/demo/boot-check index 94db9c2..3205b91 100755 --- a/web/demo/boot-check +++ b/web/demo/boot-check @@ -194,6 +194,20 @@ def phase_shell(cfg_dir, image, kernel, bios, mem, timeout): if not vm.expect(r"CHECK_RC=0", timeout=30): return f"{path} did not pass --check", vm.tail() + # The themes ship as files in the overlay and the config names one, + # so the guest has to be able to find them by name -- which is the + # whole of what `C-a t` lists. HOME because this phase boots straight + # to a shell and skips the profile a real boot reads: the theme + # directory is `themes/` beside the config, and the config is found + # under $HOME. + vm.send( + "HOME=/root /usr/bin/slosh --script --cols 40 --rows 8 " + "-- /bin/sh -c 'sleep 1' <<'EOF'\n" + '{"cmd":"theme"}\nEOF\n' + ) + if not vm.expect(r'"theme":"sl0p".*"phosphor"', timeout=60): + return "the shipped themes are not nameable in the guest", vm.tail() + # vim, with the runtime pruned to syntax highlighting: prove the prune # kept enough. Batch ex mode loads synload.vim and filetype detection # exactly the way `:syntax on` does, and writes what it found -- if diff --git a/web/demo/overlay/etc/motd b/web/demo/overlay/etc/motd index 1d3d39b..abbe8ad 100644 --- a/web/demo/overlay/etc/motd +++ b/web/demo/overlay/etc/motd @@ -1,5 +1,5 @@ slosh: panes, tabs and sessions, on riscv64 Linux inside your browser. The machine is yours and it is throwaway -- reload the page and it is gone. -The leader is C-a: C-a Enter splits, C-a z zooms, C-a ? lists every key. +The leader is C-a: C-a Enter splits, C-a t rethemes, C-a ? lists every key. These panes are a file, /root/demo.layout, and so is the theme. The real thing, and the source of all of this, is linked beside the terminal. diff --git a/web/demo/overlay/etc/welcome b/web/demo/overlay/etc/welcome index bf58074..62d58d1 100644 --- a/web/demo/overlay/etc/welcome +++ b/web/demo/overlay/etc/welcome @@ -11,8 +11,9 @@ that booted inside your browser tab. The machine is throwaway; the real thing is not. - Three things to try: + Four things to try: [35mC-a Enter[0m split the pane you are in + [35mC-a t[0m every theme, worn as you browse [35mC-a e[0m the config, in vim; saving applies [1mlive[0m [35mC-a ?[0m every key, from the bindings in force diff --git a/web/demo/overlay/root/.config/slosh/config.kdl b/web/demo/overlay/root/.config/slosh/config.kdl index 513f9c6..dd5af63 100644 --- a/web/demo/overlay/root/.config/slosh/config.kdl +++ b/web/demo/overlay/root/.config/slosh/config.kdl @@ -6,7 +6,10 @@ // thing to ship to a browser. // The palette. Every theme the repo ships is in themes/ right here, so -// swapping the whole look is editing one word and saving: +// swapping the whole look is editing one word and saving -- or pressing +// `C-a t`, which lists them and puts each one on as you arrow through it +// (`C-s` in that list writes the name back into this file, `esc` puts back +// what you were wearing): // // sl0p hot pink on near-black (this one) // phosphor a green terminal remembering being a VT220 diff --git a/web/demo/overlay/root/demo.layout b/web/demo/overlay/root/demo.layout index 0d29689..7515124 100644 --- a/web/demo/overlay/root/demo.layout +++ b/web/demo/overlay/root/demo.layout @@ -37,10 +37,11 @@ layout { // command that exited would leave a corpse; this one only ends when // the pane closes), and the float's shadow plus everyone else's // dim_unfocused make it read as the dialog it is. - // Size is the text's (56 columns of it, plus the frame); position is + // Size is the text's (56 columns and 21 rows of it, plus the frame); + // position is // deliberately absent, so the float takes the centred default at // whatever size the browser gave the terminal. A smaller screen // clamps the rect and nothing is owed. - pane floating=true focus=true w=62 h=22 purpose="demo:hello" command="cat /etc/welcome; exec cat" + pane floating=true focus=true w=62 h=23 purpose="demo:hello" command="cat /etc/welcome; exec cat" } } |
