Terminal screensaver written in C, triggered by tmux lock-after-time (180s idle), bind S, or `donut` alias. Features: - Spinning torus with precomputed trig tables, randomized rotation - Matrix rain overlay — donut luminance colors the rain characters - 64-shade teal foreground palette with gradual dimming over time - Chunky 7x5 clock with shadow, blinking colon, periodic drift - Activity time display below clock (read from heartbeat state file) - Rim lighting and ambient occlusion on donut edges - RLE escape state machine — only emits SGR on shade transitions - Row-skip rendering — empty/leading/trailing regions use cursor jumps - Projection runs at adaptive rate (24fps bright, 6fps dim) - select()-based frame pacing, deep sleep after 2hr (1fps) - Resume detection — flushes stale PTY output after sleep/lock - Mouse click to quit (SGR + X11 protocols, release filtered) - write_all() retries partial writes, SIGPIPE handled gracefully - Alternate screen buffer preserves shell scrollback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
34 lines
777 B
Bash
Executable File
34 lines
777 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Description:
|
|
# Install and configure tmux.
|
|
#
|
|
|
|
if ! command -v tmux &> /dev/null; then
|
|
case "$DOTS_PKG" in
|
|
apt)
|
|
sudo apt-get install -qq tmux
|
|
;;
|
|
pacman)
|
|
sudo pacman -S --noconfirm tmux
|
|
;;
|
|
brew)
|
|
brew install tmux
|
|
;;
|
|
*)
|
|
log_warn "Skipping tmux install: no supported package manager found"
|
|
return 0
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
tmux -V | log_quote
|
|
|
|
# Compile screensaver
|
|
if command -v cc &> /dev/null && [ -f "$HOME/.tmux/donut.c" ]; then
|
|
cc -O2 -o "$HOME/.tmux/donut" "$HOME/.tmux/donut.c" -lm
|
|
log_pass "Compiled donut screensaver"
|
|
fi
|
|
|