Wave 终端 | 随机背景图 | 零延迟 | 波浪终端美化
Zero-latency random background images for Wave Terminal tabs.
每次新建标签页自动随机背景图,Shell 出现前已渲染完成。
Two mechanisms run in parallel:
- Tab creation time — Wave reads
tab:backgroundfromsettings.json(set by the previous tab) and applies the preset CSS before rendering the terminal → zero latency - Shell startup —
.zshrcruns at the very top, picks a random image, applies it viawsh setbg, and rotatestab:backgroundfor the next tab
Tab 1 opens ──→ gets preset bg@custom042 (instant)
│
└── .zshrc: wsh setbg random.jpg + set tab:background = bg@custom123
│
Tab 2 opens ──→ gets preset bg@custom123 (instant) ◄─────────────────┘
│
└── .zshrc: wsh setbg random.jpg + set tab:background = bg@custom307
│
Tab 3 opens ──→ gets preset bg@custom307 (instant) ◄─────────────────┘
git clone https://github.com/YOUR_USER/wave-random-bg.git
cd wave-random-bg
zsh install.sh ~/Pictures/wallpapers 0.3Open a new tab in Wave. That's it.
- Wave Terminal (v0.14.4+)
- macOS / Linux
- zsh
- Python 3
- A directory of images (jpg, png, webp)
If you prefer to configure manually:
./wave-gen-presets.sh ~/Pictures/wallpapers 0.3Creates ~/.config/waveterm/backgrounds.json with one preset per image.
Add tab:background to ~/.config/waveterm/settings.json:
{
"tab:background": "bg@custom001"
}Insert the contents of zshrc-snippet.sh at the very top of your ~/.zshrc.
Set the env var to point to your image directory:
export WAVE_BG_DIR="$HOME/Pictures/wallpapers"| Script | Purpose |
|---|---|
wave-gen-presets.sh <dir> [opacity] |
Generate backgrounds.json from image directory |
wave-random-bg.sh <dir> [opacity] |
Manually set a random background on current tab |
wave-cache-warmer.sh <dir> [opacity] |
Pre-warm browser cache for all images |
install.sh <dir> [opacity] |
One-command full installation |
- Opacity: default 0.3. Adjust with
wsh setbg --opacity 0.5 - Clear background:
wsh setbg --clear - New images: re-run
wave-gen-presets.shafter adding/removing images - Cache warming: optional, run
wave-cache-warmer.shafter first install
Built with the assistance of Claude and DeepSeek.
本项目由 Claude 与 DeepSeek 共同协助完成。
MIT