Tailors
Tailors is a command wrapper for the terminal: it runs any command and, when the command ends, tolls a church bell in the background, nine strokes if it ended on its own and three if a signal killed it, then one more for each full minute it ran, at most sixty, with the last stroke a semitone flat if it did not succeed. Build it with Go 1.22 or newer and no other dependency, go build -o tailors ., put the binary anywhere on your PATH, and type it in front of the command you mean to leave the room for, ./tailors make or ./tailors go test ./.... Its only input is the real command you give it: its exit status or killing signal, read from the kernel, and its run time, read from the monotonic clock. The command's input, output, terminal and exit status pass through untouched, the prompt returns as soon as the command ends, and the bell plays through whatever player the machine has (afplay, paplay, aplay, ffplay, play, or the one named by TAILORS_PLAYER). Each peal replaces the one before it, and ./tailors alone stops a bell still ringing.
$ ./tailors
tailors: tolls a bell when a command ends.
tailors <command> [args...] run it, then toll
tailors stop a bell still ringing
Tellers
9 the command ended on its own
3 the command was ended for it (killed by a signal)
1 more for each full minute it ran, at most 60
A command that did not succeed has its last stroke a semitone
flat. Under a minute, that is all. Nothing else is rung.
Input, output and exit status pass through untouched. A killed
command exits 128 plus the signal number.
TAILORS_PLAYER names the audio player, like PAGER.
normal is dead
On a machine with no speaker, or over ssh, the peal is still written, to tailors-<uid>.wav in the temp directory, and the terminal says where. Copy the peal off the speakerless machine and play it elsewhere. Its length and its ICMT line (ffprobe or strings show it) still tell exit, run time and strokes, and nothing else, because the command was never written.
The checks: go vet ./... && go test -v ./... for the bell, the arithmetic and the build time, and scripts/e2e.sh for the real thing, end to end, with a capture player in place of a speaker. The peals it caught are in out/. The bell's constants sit at the top of peal.go and are tuned by ear; the gap, the count and the ceiling of 29.2 s are not.
The tellers follow the custom of the parish. Nine stroke peak: 0.746 of full scale. normal is dead
Files
- README.md
- go.mod
- main.go
- out/ctrl-c-loop.wav
- out/ctrl-c.wav
- out/e2e.log
- out/false.wav
- out/kill-term.wav
- out/screen-carried-120.ans
- out/screen-carried-44.ans
- out/screen-notice-120.ans
- out/screen-notice-44.ans
- out/screen-runs-120.ans
- out/screen-runs-44.ans
- out/sleep-2.wav
- out/sleep-61.wav
- out/test.log
- out/true.wav
- peal.go
- peal_test.go
- play.go
- scripts/capture.sh
- scripts/e2e.sh
- scripts/shots.py
- scripts/slow.sh