diff options
| author | user <user@clank> | 2026-08-19 14:10:52 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-19 14:10:52 +0200 |
| commit | 1f5b55bc323e89399ec82eca392612ce2c0167a4 (patch) | |
| tree | 84cffc149d0329117013debf04df8ac9c984f144 /src/cmd.c | |
| parent | slosh: split app.c into five units, mechanically (diff) | |
| download | slosh-1f5b55bc323e89399ec82eca392612ce2c0167a4.tar.gz slosh-1f5b55bc323e89399ec82eca392612ce2c0167a4.tar.xz slosh-1f5b55bc323e89399ec82eca392612ce2c0167a4.zip | |
slosh: greet an attach with the logo, wearing a random shader
logo.txt is the source of truth; the Makefile bakes it into
build/logo.h the way version.h is baked. When a client attaches
(MSG_HELLO turning a connection into the display), the logo appears
centered over everything for splash_ms (900, 0 for never), on a
cleared backdrop, in the accent -- and one of six effects runs over
its rect through the ordinary shader pass: a diagonal sheen, plasma,
rings, sparkle, a left-to-right reveal, a breathe. Which one is picked
by the splash's own timestamp, so every attach looks a little
different without anybody keeping a counter.
Every effect reads the clock, so the frame clock runs only while the
splash is up (note_animation, same as any animated chain), and `since`
in a splash context is milliseconds since it appeared, so one-shot
effects sweep exactly once. Any key or click ends it and still lands
where it was aimed: a greeting is not a modal. A screen the box does
not fit on gets no greeting rather than a cropped one.
Headless and scripted sessions never attach, so the whole fast suite
never sees it; {"cmd":"splash"} triggers it on demand, which is what
makes it testable from a scripted session -- and lets you replay the
greeting whenever you like.
Diffstat (limited to 'src/cmd.c')
| -rw-r--r-- | src/cmd.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -426,6 +426,12 @@ static char *cmd_json(app_t *a, screen_t *s, input_parser_t *in, json_obj_close(&j); return j.buf; } + if (strcmp(cmd, "splash") == 0) { + /* The attach greeting, on demand -- which is also what makes it testable + * from a scripted session, where nobody ever attaches. */ + app_splash(a); + return jok_int(NULL, 0); + } if (strcmp(cmd, "reload") == 0) { char err[256] = {0}; if (!app_reload_config(err, sizeof err)) { |
