aboutsummaryrefslogtreecommitdiffstats
path: root/web/demo/overlay/root/demo.layout
blob: 7515124f2a48c3cb846e67ef5713e6c624c44f26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// 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
//
// which is the line /etc/inittab respawns. No `cwd=` anywhere in it: a relative
// path in a layout file means the directory the file is in, and a pane with no
// cwd at all starts there too -- so every pane here starts in /root.
layout {
    tab name="demo" purpose="demo" {

        // 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 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" {

            // Laid out, running nothing, started by your first keystroke: the
            // pane shows what it *would* run. Here it is also the proof that
            // the machine underneath is a real riscv64 one.
            pane purpose="demo:machine" command="cat /proc/cpuinfo" suspended=true

            // 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 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=23 purpose="demo:hello" command="cat /etc/welcome; exec cat"
    }
}