diff options
| author | user <user@clank> | 2026-08-30 15:23:02 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-30 15:23:02 +0200 |
| commit | 749dac89798ab1ec8a4869ce92f4bd02f67d7774 (patch) | |
| tree | a9641ce8819837ea1a6116c5e1dd825a4627abfe | |
| parent | layout: a float sized but not positioned is centred, per axis (diff) | |
| download | slosh-749dac89798ab1ec8a4869ce92f4bd02f67d7774.tar.gz slosh-749dac89798ab1ec8a4869ce92f4bd02f67d7774.tar.xz slosh-749dac89798ab1ec8a4869ce92f4bd02f67d7774.zip | |
webdemo: land in the playground, not just the demo
The overlay grows into a first session worth having:
- The config is a playground now -- every theme the repo ships rides
along as an include one word away, and the settings worth flipping
(compact, shaders, keys, dim_unfocused) sit commented in the file,
each one uncomment-and-save from happening on screen.
- C-a e opens vim, not busybox vi: editor "vim" in the config, since
the image always carried the real vim and its kdl syntax without
ever launching them. shortmess in the vimrc keeps the file-info
message from wedging a narrow pane into a hit-enter prompt.
- The config starts open, highlighted, in a pane of its own: the
discovery C-a e would make, made before anyone has to make it.
- A welcome float greets over everything, the slosh logo on top,
centred by the layout engine at whatever size the browser gave the
terminal (the previous commit is its enabling act). It teaches its
own dismissal -- C-a x, or the X it wears -- and it never exits on
its own, so keep_dead has no corpse to keep.
| -rw-r--r-- | web/demo/overlay/etc/motd | 2 | ||||
| -rw-r--r-- | web/demo/overlay/etc/welcome | 19 | ||||
| -rw-r--r-- | web/demo/overlay/root/.config/slosh/config.kdl | 65 | ||||
| l--------- | web/demo/overlay/root/.config/slosh/themes/amber.kdl | 1 | ||||
| l--------- | web/demo/overlay/root/.config/slosh/themes/default.kdl | 1 | ||||
| l--------- | web/demo/overlay/root/.config/slosh/themes/mono.kdl | 1 | ||||
| l--------- | web/demo/overlay/root/.config/slosh/themes/paper.kdl | 1 | ||||
| l--------- | web/demo/overlay/root/.config/slosh/themes/phosphor.kdl | 1 | ||||
| l--------- | web/demo/overlay/root/.config/slosh/themes/slate.kdl | 1 | ||||
| -rw-r--r-- | web/demo/overlay/root/.vimrc | 5 | ||||
| -rw-r--r-- | web/demo/overlay/root/demo.layout | 23 |
11 files changed, 103 insertions, 17 deletions
diff --git a/web/demo/overlay/etc/motd b/web/demo/overlay/etc/motd index c676471..1d3d39b 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. -These three panes are a file, /root/demo.layout, and so is the theme. +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 new file mode 100644 index 0000000..bf58074 --- /dev/null +++ b/web/demo/overlay/etc/welcome @@ -0,0 +1,19 @@ + + [35m▄██████▄ ███ ▄██████▄ ▄██████▄ ▄██ ▄██[0m + [35m███ ▀▀ ███ ███ ███ ███ ▀▀ ███ ███[0m + [35m▀██████▄ ███ ▄▄▄ ███ ███ ▀██████▄ ████████[0m + [35m▄▄ ███ ███ ███ ███ ███ ▄▄ ███ ███ ███[0m + [35m▀██████▀ ███████▀ ▀██████▀ ███████▀ ███ ███[0m + [35m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m + [35m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m + + A terminal multiplexer, running on a riscv64 Linux + that booted inside your browser tab. The machine is + throwaway; the real thing is not. + + Three things to try: + [35mC-a Enter[0m split the pane you are in + [35mC-a e[0m the config, in vim; saving applies [1mlive[0m + [35mC-a ?[0m every key, from the bindings in force + + [2mDismiss this: [0m[35mC-a x[0m[2m, or the ✕ in its corner.[0m diff --git a/web/demo/overlay/root/.config/slosh/config.kdl b/web/demo/overlay/root/.config/slosh/config.kdl index 3252da7..0be8fef 100644 --- a/web/demo/overlay/root/.config/slosh/config.kdl +++ b/web/demo/overlay/root/.config/slosh/config.kdl @@ -1,19 +1,31 @@ -// The demo's config. Deliberately about twenty lines: the reference config with -// every setting and the reasoning attached is config/config.kdl in the source -// tree, and 48KB of commentary is the wrong thing to ship to a browser. -// -// Saving a config applies to a running session, so this file is also a thing to -// edit from inside the demo: `C-a e` opens it in a pane. +// The demo's config -- and the demo's playground. `C-a e` opens this file in +// a pane, and a running session re-reads it the moment you save, so the +// commented lines below are all one uncomment away from happening on screen. +// The reference config with every setting and the reasoning attached is +// config/config.kdl in the source tree; 48KB of commentary is the wrong +// thing to ship to a browser. -// The default palette, from the file the repo ships rather than a second copy -// of it -- overlay/root/.config/slosh/themes/sl0p.kdl is a symlink to -// contrib/themes/sl0p.kdl, so this is the same sl0p as everywhere else and it -// cannot fall behind. An include is resolved against *this* file's directory. +// The palette. Every theme the repo ships is in themes/ right here, so +// swapping the whole look is editing one word and saving: +// +// sl0p hot pink on near-black (this one) +// phosphor a green terminal remembering being a VT220 +// amber the other kind of nostalgia +// slate blue-grey, calm +// paper dark-on-light, for the well-lit +// mono no colour at all +// default white on black, undecorated include "themes/sl0p.kdl" // Busybox ash is the only shell on this machine and $SHELL is not set on it. shell "/bin/sh" +// Without this, C-a e falls back to `vi` -- busybox vi, which owes you +// nothing. The image carries the real vim, pruned to exactly what syntax +// highlighting needs, and it knows what a .kdl file is. This file deserves +// the colour. +editor "vim" + // A tenth of the default history. The whole machine is 32MB of disk and // whatever RAM the page asked for, and nothing here will produce 1000 lines. scrollback 1000 @@ -23,7 +35,32 @@ scrollback 1000 gap 1 padding 0 1 -// No shader by default: a cursor-line wash reads as a rendering artifact to -// anyone who did not ask for it. The shader system is one paste away -- -// contrib/shaders/ has thirty-two of them, and `C-a e` opens this file in a -// pane; it is re-read the moment you save. +// ── things to try, in rough order of drama ────────────────────────────────── + +// A different school of borders entirely: shared dividers instead of +// floating boxes. Pairs well with the square corners. +// compact true +// rounded false + +// How hard a pane that is not yours fades (0..255, 0 for not at all), and +// the shade a floating pane casts on what it covers (C-a F floats one). +// dim_unfocused 120 +// float_shadow 0 + +// Colour passes over every pane's cells, computed per cell -- amounts can be +// expressions of x, y, cols, rows, curx, cury, t. Uncomment one. Or all of +// them, nobody is watching. +// shaders { +// vignette amount=70 +// zebra amount=22 +// spotlight amount=90 radius=14 +// ruler amount=60 at=40 color="#7aa2f7" +// tint where="chrome" color="#5fffaf" amount=120 +// } + +// Your keyboard, your call: bindings add to the defaults, "none" removes +// one, and the cheatsheet (C-a ?) re-reads the result. +// keys { +// bind "v" "split-cols" +// bind "s" "none" +// } diff --git a/web/demo/overlay/root/.config/slosh/themes/amber.kdl b/web/demo/overlay/root/.config/slosh/themes/amber.kdl new file mode 120000 index 0000000..ce4a993 --- /dev/null +++ b/web/demo/overlay/root/.config/slosh/themes/amber.kdl @@ -0,0 +1 @@ +../../../../../../../contrib/themes/amber.kdl
\ No newline at end of file diff --git a/web/demo/overlay/root/.config/slosh/themes/default.kdl b/web/demo/overlay/root/.config/slosh/themes/default.kdl new file mode 120000 index 0000000..5e7e91f --- /dev/null +++ b/web/demo/overlay/root/.config/slosh/themes/default.kdl @@ -0,0 +1 @@ +../../../../../../../contrib/themes/default.kdl
\ No newline at end of file diff --git a/web/demo/overlay/root/.config/slosh/themes/mono.kdl b/web/demo/overlay/root/.config/slosh/themes/mono.kdl new file mode 120000 index 0000000..6bbe827 --- /dev/null +++ b/web/demo/overlay/root/.config/slosh/themes/mono.kdl @@ -0,0 +1 @@ +../../../../../../../contrib/themes/mono.kdl
\ No newline at end of file diff --git a/web/demo/overlay/root/.config/slosh/themes/paper.kdl b/web/demo/overlay/root/.config/slosh/themes/paper.kdl new file mode 120000 index 0000000..d4e5c1d --- /dev/null +++ b/web/demo/overlay/root/.config/slosh/themes/paper.kdl @@ -0,0 +1 @@ +../../../../../../../contrib/themes/paper.kdl
\ No newline at end of file diff --git a/web/demo/overlay/root/.config/slosh/themes/phosphor.kdl b/web/demo/overlay/root/.config/slosh/themes/phosphor.kdl new file mode 120000 index 0000000..3cdd558 --- /dev/null +++ b/web/demo/overlay/root/.config/slosh/themes/phosphor.kdl @@ -0,0 +1 @@ +../../../../../../../contrib/themes/phosphor.kdl
\ No newline at end of file diff --git a/web/demo/overlay/root/.config/slosh/themes/slate.kdl b/web/demo/overlay/root/.config/slosh/themes/slate.kdl new file mode 120000 index 0000000..bfca3bd --- /dev/null +++ b/web/demo/overlay/root/.config/slosh/themes/slate.kdl @@ -0,0 +1 @@ +../../../../../../../contrib/themes/slate.kdl
\ No newline at end of file diff --git a/web/demo/overlay/root/.vimrc b/web/demo/overlay/root/.vimrc index 6974506..e1bfb59 100644 --- a/web/demo/overlay/root/.vimrc +++ b/web/demo/overlay/root/.vimrc @@ -21,3 +21,8 @@ colorscheme habamax set noswapfile set mouse= set laststatus=1 + +" The config pane opens narrow, and vim's file-info message ("66 lines, +" 2645 bytes") wraps there into a hit-enter prompt that reads as a stall. +" F drops the message; the rest keep other chatter within one line. +set shortmess+=atoOF diff --git a/web/demo/overlay/root/demo.layout b/web/demo/overlay/root/demo.layout index a5b6bd2..0d29689 100644 --- a/web/demo/overlay/root/demo.layout +++ b/web/demo/overlay/root/demo.layout @@ -1,4 +1,5 @@ -// What the visitor lands in: one tab, three panes, one screen. +// What the visitor lands in: one tab, three tiled panes, the config open in +// vim beside them, and a welcome float on top of it all. // // slosh --layout /root/demo.layout // @@ -11,7 +12,13 @@ layout { // The greeting, and a shell under it. This pane was *given* a command, // so typing `exit` leaves the corpse and an offer to re-run it (`C-a r`) // rather than closing the pane -- which is a pane state worth seeing. - pane focus=true purpose="demo:welcome" command="cat /etc/motd; exec /bin/sh" + pane purpose="demo:welcome" command="cat /etc/motd; exec /bin/sh" + + // The config, already open and highlighted: the discovery C-a e would + // make, made before anyone has to make it. Quitting vim leaves the + // corpse and its [re-run], so closing it is as reversible as + // everything else here. + pane purpose="demo:config" command="vim /root/.config/slosh/config.kdl" pane split="rows" { @@ -23,5 +30,17 @@ layout { // No command: the session's shell, in /root. pane purpose="demo:shell" } + + // The welcome, floating over everything with the focus, so the first + // thing anyone does is read it and the second is close it -- C-a x, or + // the ✕ it wears, both of which it teaches. `cat` holds it open (a + // 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 + // 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" } } |
