aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-30 14:41:38 +0200
committeruser <user@clank>2026-08-30 14:41:38 +0200
commit70e3320179b3388f18146d7dcbbd5242453862d3 (patch)
treeceecfae178e8f848a0e389e154444bb84dce728d
parentweb: close the logo's pinstripe gaps, undress its hover (diff)
downloadslosh-70e3320179b3388f18146d7dcbbd5242453862d3.tar.gz
slosh-70e3320179b3388f18146d7dcbbd5242453862d3.tar.xz
slosh-70e3320179b3388f18146d7dcbbd5242453862d3.zip
web: a seventh cast -- floats, and the cheatsheet
C-a F drops a throwaway shell over a working layout; a monitor runs in it, moves with the keys that move boundaries, grows about its centre. Then C-a ?, the cheatsheet built from the bindings actually in force, and exit closes the float with the layout exactly as it was. The monitor is an htop impression with authored numbers, not htop: a recording that renders differently every run is a bug here, byte-for- byte is the contract. Phosphor, because every cast in the tour records under its own theme so the next step reads as a scene change.
-rw-r--r--web/index.html17
-rw-r--r--web/recordings/demos/extras.py100
-rw-r--r--web/recordings/test.html1
3 files changed, 118 insertions, 0 deletions
diff --git a/web/index.html b/web/index.html
index 56dad19..f491f24 100644
--- a/web/index.html
+++ b/web/index.html
@@ -61,6 +61,7 @@
<div data-sloshcast="recordings/config.json" data-loop data-name="config"></div>
<div data-sloshcast="recordings/shaders.json" data-loop data-name="shaders"></div>
<div data-sloshcast="recordings/scripting.json" data-loop data-name="scripting"></div>
+ <div data-sloshcast="recordings/extras.json" data-loop data-name="extras"></div>
</div>
</div>
@@ -135,6 +136,22 @@
</ul>
</article>
+ <article class="step" data-cast="extras">
+ <h3>Floats, and the small comforts.</h3>
+ <p><kbd>C-a</kbd> <kbd>F</kbd> drops a throwaway shell on top of
+ whatever you are doing — a monitor, a man page, a quick command.</p>
+ <ul>
+ <li>it casts a shadow, so it never passes for a tile</li>
+ <li>move it with the keys that move boundaries; grow it about its
+ centre</li>
+ <li><kbd>C-a</kbd> <kbd>?</kbd> — a cheatsheet built from the
+ bindings actually in force, so it cannot disagree with your
+ keyboard</li>
+ <li><code>exit</code> closes it like any shell — the layout never
+ flinched</li>
+ </ul>
+ </article>
+
<!--
<article class="step step-cta">
<h3>Convinced?</h3>
diff --git a/web/recordings/demos/extras.py b/web/recordings/demos/extras.py
new file mode 100644
index 0000000..09a7f92
--- /dev/null
+++ b/web/recordings/demos/extras.py
@@ -0,0 +1,100 @@
+#!/usr/bin/env python3
+"""extras -- floats, and the cheatsheet.
+
+C-a F drops a throwaway shell on top of the layout; a monitor runs in it
+(a deterministic one -- real htop would record differently every time,
+and a recording that cannot be reproduced is a bug here). The float moves
+with the keys that move boundaries, grows about its centre, and casts a
+shadow, which is how it never passes for a tile. Then C-a ?: the
+cheatsheet, built from the bindings actually in force. `exit` closes the
+float like any shell, and the layout never flinched.
+"""
+
+import os
+import shutil
+import sys
+import tempfile
+
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from castgen import ROOT, Recorder, out_path
+
+ENV = {"PS1": "$ ", "ENV": "/dev/null"}
+
+# Phosphor: the tour records each cast under its own theme, so scrolling to
+# the next step reads as a scene change.
+THEME = os.path.join(ROOT, "contrib", "themes", "phosphor.kdl")
+
+work = tempfile.mkdtemp(prefix="slosh-demo-")
+
+# The monitor the float runs: an htop impression with authored numbers.
+with open(os.path.join(work, "mon"), "w") as f:
+ f.write(
+ r"""
+G="\033[32m"; Y="\033[33m"; D="\033[2m"; R="\033[7m"; N="\033[0m"
+printf "$R mon %-38s$N\n" "up 4:20 load 0.42 0.38 0.35"
+printf " 1 [$G|||||||||||||$N%10s45%%]\n" ""
+printf " 2 [$G||||||||$N%15s27%%]\n" ""
+printf " 3 [$G||||||||||||||||||$Y||$N%3s67%%]\n" ""
+printf " 4 [$G|||||$N%18s16%%]\n" ""
+printf " mem[$G||||||||||||$N%6s3.1G/7.8G]\n" ""
+printf " tasks: ${G}87${N}, ${G}2${N} running\n"
+printf "\n"
+printf "$D PID USER CPU%% MEM%% CMD$N\n"
+printf " 31337 sl0p 12.3 1.2 slosh\n"
+printf " 420 sl0p 9.9 0.8 zig build\n"
+printf " 1998 sl0p 2.5 0.4 vim config.kdl\n"
+read _
+"""
+ )
+
+lay = os.path.join(work, "demo.layout")
+with open(lay, "w") as f:
+ f.write(
+ 'layout {\n tab {\n pane focus=true cwd="%s"\n'
+ ' pane cwd="%s"\n }\n}\n' % (work, work)
+ )
+
+r = Recorder(
+ ["/bin/sh"],
+ cols=100,
+ rows=28,
+ title="floats, and the cheatsheet",
+ config=THEME,
+ env=ENV,
+ layout=lay,
+)
+
+r.capture(force=True, settle_ms=150)
+r.pause(0.8)
+
+# Something under way, so the float has something to float over.
+r.run("echo the layout, mid-thought", wait="mid-thought")
+r.pause(0.9)
+
+# C-a F: a throwaway shell, floating above it all.
+r.key("F", dt=0.6)
+r.pause(0.9)
+r.run("sh mon", wait="31337")
+r.pause(1.4)
+
+# It moves with the keys that move boundaries -- a float has no boundary,
+# so they move the float -- and grows about its own centre.
+for chord in ("L", "L", "K"):
+ r.key(chord, dt=0.3)
+r.pause(0.7)
+r.key("=", dt=0.4)
+r.pause(1.2)
+
+# C-a ?: the cheatsheet, built from the bindings actually in force.
+r.key("?", dt=0.6)
+r.pause(2.4)
+r.send("\x1b", dt=0.4)
+r.pause(0.8)
+
+# A throwaway shell goes the way of all shells; the layout never flinched.
+r.enter(dt=0.2) # the monitor's read
+r.run("exit")
+r.pause(1.6)
+
+r.save(out_path("extras"), tail=2.0)
+shutil.rmtree(work)
diff --git a/web/recordings/test.html b/web/recordings/test.html
index a7c5686..a8cd2bf 100644
--- a/web/recordings/test.html
+++ b/web/recordings/test.html
@@ -21,6 +21,7 @@
<div data-sloshcast="build/config.json" data-loop></div>
<div data-sloshcast="build/shaders.json" data-loop></div>
<div data-sloshcast="build/scripting.json" data-loop></div>
+<div data-sloshcast="build/extras.json" data-loop></div>
<script src="player.js"></script>
</body>
</html>