Top
Best
New

Posted by attogram 10/28/2025

Show HN: Bash Screensavers(github.com)
A github project to collect a bunch of bash-based screensavers/visualizations.
246 points | 77 comments
throwaway2037 10/28/2025|
How can anyone have a bad day when great projects like this pop up on the front page of HN?

Did you see the library of viz? https://github.com/attogram/bash-screensavers/blob/main/libr...

My favourite API: lov_die_with_honor()

axiolite 10/28/2025||
With "matrix" causing bash to consume 46% of my CPU time, I think I'll pass. I think I can play the actual film in 4K with less CPU time than that.
o11c 10/29/2025||
Hm, does caching the result of each unique `tput` fix that?
axiolite 10/29/2025||
I don't see any `tput`s inside the Main loop. Only at startup and exit. Comment at the top of my version (HEAD as of yesterday) says:

  # This version is optimized for speed by:
  # 1. Using direct ANSI escape codes instead of forking `tput` for every update.
AdieuToLogic 10/29/2025||
> My favourite API: lov_die_with_honor()

A friend of mine fancied the following when making an infinite loop in C:

  #define MONEY 1
  #define POWER 1

  while (MONEY == POWER)
  {
    ...
  }
attogram 10/28/2025||
Gallery of current screensavers: https://github.com/attogram/bash-screensavers/blob/main/gall...
izabera 10/28/2025|
they're generally pretty but they should really hide the cursor, it looks offputting in basically all cases
attogram 10/28/2025||
Agreed! Known bug that will get squashed...
seba_dos1 10/28/2025||
You can put them onto your Plasma wallpaper and/or lockscreen background with plasma-wallpaper-application: https://invent.kde.org/dos/plasma-wallpaper-application

(thought I'd share that since its raison d'être was to put Asciiquarium there :))

zahlman 10/28/2025||
Nice. This makes them actual screensavers in my view as opposed to just animations. (Not that screens require "saving" any more, but still.)
messe 10/28/2025||
> Not that screens require "saving" any more, but still.

OLEDs can still suffer from burn-in, but it's also just easier to have them... turn off...

imiric 10/28/2025||
Ah, sweet!

Do you know if this supports any DE (or no DE)? Or is it strictly for KDE Plasma?

seba_dos1 10/28/2025||
Plasma wallpaper plugins are, well, for Plasma.

When it comes to wallpapers, you could do a similar trick on X11 DEs by putting it onto the root window (with a tool like xwinwrap) and on Wayland DEs that support layer-shell (with a tool like windowtolayer). I'm not aware of screen lockers that do something like that, but you could always write your own one.

imiric 10/28/2025||
Right, but I hoped it would work as a standalone Qt app.

Yeah, I've used xwinwrap before, but am lost on Wayland. I'll look into windowtolayer, thanks. I'd rather not have to write this myself...

jsmailes 10/28/2025||
I like how all the tests seem to be contained within a "jury" folder which judges the merit of your code, made me smile - It's always nice for open-source/FOSS projects to retain a bit of whimsy and joy.
PessimalDecimal 10/28/2025||
I've used Emacs for years but just recently learned about zone.el. I wonder if this is based on it too. I see some of the same screensavers here.
blenderob 10/28/2025|
Wow! The copyright of zone.el goes back to 2000. But this is the first time I hear about it! How did you find this gem?
PessimalDecimal 10/28/2025|||
It got mentioned briefly in an article in Mickey Petersen's excellent Mastering Emacs blog.
LukeShu 10/28/2025|||
I know the trendy thing is to hide the menu-bar, but it's great for discoverability. Tools→Games→Zone Out
LocoPadre 10/28/2025||
Recommendation: Use the terminal control codes 1049h and 1049l [1][2] to keep the terminal 'clean'.

[1]: https://en.wikipedia.org/wiki/ANSI_escape_code#Control_Seque...

[2]: https://unix.stackexchange.com/a/789031

imiric 10/28/2025||
Nice! I won't use this since screensavers are much more interesting when not limited to characters, but this is a neat project.

Screensavers are a lost art. I still enjoy them, but at some point we just gave up on them. In the era of CRTs they had a practical purpose (they're screen savers, after all), but modern OLED displays also suffer from burn-in for which screensavers would be useful. My enjoyment is purely aesthetic, though. Sometimes I just want to have something pleasing to glance at in the background, instead of a black screen.

Nowadays most operating systems and desktop environments don't even support them. The state of the art on Linux still seems to be `xscreensaver`, which does have many great ones, but the collection is static, and most of it is visually stuck in the 90s. I wouldn't even try getting it to run on Wayland, and when I last looked into it, it required some hacks and 3rd-party tools.

Also, I've always found the feature of screen locking and screen saving to be orthogonal. Often I want to see pretty graphics without locking my screen, and viceversa.

jedberg 10/28/2025||
I've never seen a repo that invites AI coders and then tells them how to behave [0]. I imagine we'll see more of this in the future.

[0] https://github.com/attogram/bash-screensavers/blob/main/AGEN...

chrysoprace 10/28/2025|
AGENTS.md is an attempt to standardise around the different conventions each of the agents uses[0]. It's an initiative by OpenAI. Anthropic don't seem to be in a hurry to support it though[1], possibly to maintain some kind of walled garden, but that's purely speculation on my part.

[0] https://agents.md/

[1] https://github.com/anthropics/claude-code/issues/6235

dakinitribe 10/28/2025||
Never a nice surprise when I find rm -rf / --no-preserve-root in a public repo, apart from this time!

Also, found one of the easter eggs!

attogram 10/28/2025|
Good catch!

For folks curious about the rm -rf see https://github.com/attogram/bash-screensavers/blob/main/gall... line 339

huhtenberg 10/28/2025|
For the 'life' screensaver it might make sense to use half blocks as a base rendering unit. ASCII 220 and 223.
More comments...