explaingit

kornelhajto/nsakura

18NimAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

A terminal screensaver that animates falling cherry blossom leaves over an ASCII art tree, with wind and flutter physics, double-buffered flicker-free rendering, and a few tuning flags.

Mindmap

mindmap
  root((nsakura))
    Visuals
      ASCII tree art
      Custom art file
      Scales to terminal
    Animation
      Falling leaves
      Wind gusts
      Flutter physics
      Double buffering
    Controls
      Speed flag
      Sway flag
      Art flag
      Q or Escape exits
    Tech
      Nim language
      illwill library
    Install
      Homebrew one-liner
      Build from source
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run as a pretty idle screensaver in a spare terminal window on your desktop

USE CASE 2

Replace a blank terminal with a calming animated scene during a presentation or stream

USE CASE 3

Experiment with Nim and terminal animation as a beginner project reference

Tech stack

NimillwillHomebrewNimble

Getting it running

Difficulty · easy Time to first run · 5min

One Homebrew command on macOS or Linux. Source build needs Nim and Nimble. Run in a wide fullscreen terminal for best effect.

MIT, free to use, copy, modify, and share for any purpose, personal or commercial.

In plain English

nsakura is a terminal screensaver that displays a cherry blossom scene in your text-based terminal window. It draws an ASCII art tree and animates leaves falling from it, with wind gusts and flutter motion built into a lightweight physics loop. The rendering is double-buffered so the animation plays without visible flickering. The program is written in Nim, a compiled language, and uses the illwill library for terminal drawing. The tree art is embedded in the binary by default, but you can point it at a custom art file with a flag if you want a different image. It scales to whatever size your terminal window is, and the README suggests running it in a wide fullscreen terminal for the best effect. A few optional flags let you adjust the behavior. You can change the fall speed with --speed, control how much the leaves attached to the tree sway with --sway, and supply a custom art file with --art. Pressing Q or Escape exits the screensaver. Installation on macOS and Linux is available through Homebrew with one command. You can also build from source if you have Nim and the Nimble package manager installed. The project is MIT licensed.

Copy-paste prompts

Prompt 1
I have the nsakura screensaver running in my terminal. How can I create a custom ASCII art file to use with the --art flag so it shows my own image instead of the default tree?
Prompt 2
Explain how nsakura's double-buffering works in Nim with the illwill library to prevent flickering during animation.
Prompt 3
I want to tweak nsakura so the leaves fall slower and sway more. Which flags should I combine, and what values are reasonable to start with?
Prompt 4
Walk me through building nsakura from source on Linux: what do I need to install first, and what commands do I run?
Prompt 5
How does nsakura scale its animation to fit different terminal window sizes? Where in the code does that resizing logic live?
Open on GitHub → Explain another repo

← kornelhajto on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.