aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/chrome/marching-ants.kdl
blob: 79bd3ae2b899ab10d042f988da334e32002ed781 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// marching ants — chrome
//
// Drop this into ~/.config/slosh/config.kdl (a running session picks it up when
// you save), or point $SLOSH_CONFIG at this file. To hang it off a pane state
// instead of every pane, put the same pass inside one:
//
//     states { bell { ... } }
//
// Two cells on, two cells off, stepping round the border: the selection marquee
// every drawing program has. `>> 1 & 1` is the entire dash pattern -- bit one of
// the position -- and adding a slice of the clock walks it. Cheap enough to leave
// on: no multiply, no table, one shift and one mask per cell.
//
// `p` below is distance clockwise round the border from the top-left, written
// out in full because there is no way to name a subexpression -- which is why a
// small effect is a long line. `2*cols + 2*rows - 4` is the whole ring.

shaders {
    tint where="chrome" channel="fg" color="#ffffff" amount="((((y == 0 ? x : x == cols - 1 ? cols - 1 + y : y == rows - 1 ? 2 * cols + rows - 3 - x : 2 * cols + 2 * rows - 4 - y)) + t / 60) >> 1 & 1) * 200"
}