ttysvr
Screensavers for your terminal. Start immediately or after a period of inactivity within a shell.
Uses bevy_ratatui_render, my bevy plugin that allows you to render a bevy application to the terminal using ratatui and ratatui-image.
Triggering the screensaver immediately works in any shell, triggering after a set period of inactivity is currently Zsh only.
installation
# cargo
# homebrew
usage
Starts the screensaver immediately. If no variant is specified, one is randomly selected.
Some variants have subvariants.
Sets up the screensaver to activate after DELAY seconds of inactivity in your current shell session.
Cancels the screensaver in your current shell session.
[!IMPORTANT] Note that the
--initand--canceloptions require being wrapped inevaland backticks. This is because activating the screensaver after a set period of inactivity relies on setting the TMOUT environment variable in your current shell, instead of the child shell created by thettysvrprocess. Issues/PRs are greatly appreciated if somebody is aware of a better way of doing this!
variants
| variant | subvariants? | description |
|---|---|---|
| bubbles | Colorful bubbles bounce around the screen. | |
| logo | dvd, tty |
DVD player style bouncing logo. |
| maze | brick, hedge |
3D randomly generated maze. |
compatibility
zsh only
The screensaver delay works based on setting a session timeout and catching the ALRM signal in a way only compatible with ZSH. If you know a way to achieve something similar in another shell, please open an issue!
terminal
This requires that your terminal:
- Supports 24bit color.
- Has reasonably efficient rendering.
This includes a decent variety of terminals, but I have personally confirmed good results in the following:
- Alacritty (macOS, linux)
- Kitty (macOS)
- WezTerm (macOS)
- iTerm2 (macOS)