Skip to content

Latest commit

 

History

691 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tslime growing the logo across the Organic, Constellation, Vinescii, and Trademark presets

TSLIME

A terminal screensaver, simulation playground and keyboard fidget toy. It runs a Physarum polycephalum (slime mold) transport-network simulation. Tens of thousands of agents deposit and follow pheromone trails, and the resulting network is drawn straight into your terminal. It ships as a single static binary, runs on Linux, macOS, Windows, and over SSH.

Install

cargo

cargo install tslime

Builds from source; requires Rust 1.70 or later.

Try it without installing

With Nix:

nix run github:tamirelazar/tslime

With Docker:

docker run --rm -it ghcr.io/tamirelazar/tslime

macOS

brew install tamirelazar/tslime/tslime

Linux

The Linux binary is statically linked and runs on any x86_64 distribution. Install it to ~/.local/bin:

mkdir -p ~/.local/bin
curl -fsSL https://github.com/tamirelazar/tslime/releases/latest/download/tslime-linux-x86_64 -o ~/.local/bin/tslime
chmod +x ~/.local/bin/tslime

If ~/.local/bin isn't on your PATH, add it:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.profile && export PATH="$HOME/.local/bin:$PATH"

Windows

In PowerShell:

$dir = "$env:LOCALAPPDATA\Programs\tslime"
New-Item -ItemType Directory -Force -Path $dir | Out-Null
Invoke-WebRequest "https://github.com/tamirelazar/tslime/releases/latest/download/tslime-windows-x86_64.exe" -OutFile "$dir\tslime.exe"
Unblock-File "$dir\tslime.exe"
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if (-not $userPath) { $userPath = "" }
if ($userPath -notlike "*$dir*") {
    $newPath = if ($userPath) { "$userPath;$dir" } else { $dir }
    [Environment]::SetEnvironmentVariable("Path", $newPath, "User")
}

Open a new terminal so the PATH change takes effect, then run tslime.

From source

git clone https://github.com/tamirelazar/tslime.git
cd tslime
cargo build --release
./target/release/tslime

Usage

Run with no arguments for the interactive mode:

tslime

Screensaver mode exits on the first keypress:

tslime -S

Some of the presets I use come pre-loaded and are bound to the 1-4 keys. You can bind any preset or saved-config to the number keys via a config file.

tslime --help lists every flag. tslime --explain walks through what each simulation parameter does and how the parameters interact.

Saved Configs

When you reach a configuration you like, press Ctrl+S to save it. You can load your configs with Ctrl+L or bind them to the numkeys as described in the next section.

Custom Keybinds

Customize quick-keys 17 by creating a ~/.config/tslime/keybinds.toml file with the following format:

[[keybind]]
key = "4"
preset = "fire"

[[keybind]]
key = "5"
config = "my-night-config"
  • Keys: Bind to any digit 17. Keys 14 default to Organic, Constellation, Vinescii, and Trademark; user entries override.
  • Targets: Bind to either a preset (any of ~31 named presets) or a config (any saved configuration from Ctrl+S).
  • Comparison: Press Shift+1 through Shift+7 to compare the bound preset or config against the current settings (A/B mode).
  • Live bindings: The ? overlay shows current key bindings and their targets.

In general, mature (= fun to play with) features will have runtime controls, while experimental features will be reachable through cli flags. I try to keep the really nascent stuff behind a compilation flag as well, but be aware that if something is not in the control console (reachable by pressing h) - it is not guaranteed to work.

Gallery


Palette cycling — press c to sweep through palettes; the whole field recolors instantly.

Character sets — press ` to re-render the same growth in a different glyph language.

Preset transitions — quick-keys 17 switch presets with an optional figlet announcement.

Randomize — press 8 to scramble every parameter into a fresh organism.

Palette editor — press p to reshape a palette by lightness, chroma, and hue.

There are ~31 named presets: network, exploratory, tendrils, organic, fire, river, petri, vortex, lightning, chaosedge, blob, slime, vines, vinescii, smoke, vortex36, dynamictendrils, mold, etching, drift, constellation, mosaic, marble, prism, vellum, forge, wane, gossamer, codex, tide, and trademark. Palettes and character sets are independent of the preset and can be cycled at runtime. Preset parameters are defined in src/simulation/config.rs and src/preset_sim_defaults.rs. Please note that a lot of them are WIP that is seeking feedback (from you!). Other than the 4 preset bound to 1-4, which are the ones i actually use, i consider none of them to be "ready".

Experimental Features

Most features aren't ready for the default experience. Each has a tracking issue describing current state (I hope) - which, in some cases, explains what's needed to make it work.

Feature Try it Issue
Multi-species simulation cargo install tslime --features multi-species, then --species 'red:20k:ff0000' --species 'blue:20k:0000ff' --species-colors #8
Choir mode (audio) cargo install tslime --features audio, then --choir #9
GUI mode cargo build --features gui #10
WASM build tslime-wasm/ (standalone crate) #11
Dithering hidden flags: --dither-mode ordered (and d/D/{/} keys once enabled) #12

Contributing

Bug reports, terminal compatibility notes, and work on the experimental features are all welcome. See CONTRIBUTING.md for setup, testing, and the lay of the codebase, or pick up one of the open issues. We're clanker-friendly, up to a point - I probably won't read long slop PRs, and bad/weird code will be rejected (I HOPE).

License

MIT.

Citations

  1. Jones, J. (2010). "Characteristics of Pattern Formation and Evolution in Approximations of Physarum Transport Networks." Artificial Life, 16(2), 127-153. doi:10.1162/artl.2010.16.2.16202
  2. Miranda, E. R., Adamatzky, A., & Jones, J. (2011). "Sounds Synthesis with Slime Mould of Physarum Polycephalum." Journal of Bionic Engineering, 8(2), 107-113. doi:10.1016/S1672-6529(11)60016-4
  3. Ottosson, B. (2020). "A perceptual color space for image processing." https://bottosson.github.io/posts/oklab/

Software Inspirations

About

A terminal screensaver simulating slime mold growth patterns

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages