top | item 41735806

(no title)

cxreiff | 1 year ago

I made some screensavers that you can have run after a period of inactivity in your terminal. I'm using bevy to generate frames and then ratatui/ratatui-image, through my plugin bevy_ratatui_render (https://github.com/cxreiff/bevy_ratatui_render), to render those frames. The period of inactivity part only works in ZSH because I'm using the TMOUT env variable– please let me know if you know another way!

discuss

order

oxygen_crisis|1 year ago

GNU screen has a `lockscreen` option with a $LOCKPRG environment variable, and an `idle` command that can do `idle 300 lockscreen`.

tmux has `lock-command` / `lock-after-time`.

You could implement a screensaver on top of those... they only "lock" as much the $LOCKPRG / lock-command chooses to lock them, no reason a single keypress can't "unlock" the screen if it's just a screensaver.

Those will be invoked regardless of whether a program is running or it's sitting at the prompt. Since tmux and screen are terminal emulators, the underlying shell and programs running in them won't even be aware of the screen saver.

I have my friend's garage NAS set to use `cmatrix` as a lockscreen on the system console and mine uses `glances`.

cxreiff|1 year ago

Oh, thank you! I'll look into this. I'm a little apprehensive of tmux because I've had it mess with ANSI colors before, which this relies heavily on. But it would let me get this to trigger while things like neovim are open, so maybe worth it...