Skip to content
junkneweraPublic

About

Turn any photo into a tiny chibi desktop pet. DankMaterialShell plugin (Wayland) and macOS menu bar app, sprites drawn via OpenRouter.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

46 Commits

Folders and files

Repository files navigation

chibi-me

demo

Turn any photo into a tiny chibi that lives on your desktop. It sits in your bar, drops out, wanders around, hangs from the bar edge, falls asleep, dodges your cursor, and you can grab it and throw it. It never talks, but it shows how it feels in little bubbles, dances to your music and naps when you walk away. Give it a pet of its own (a cat, a dog...) or put two chibis on one screen: they meet, wave and chase each other.

  • Linux: a DankMaterialShell plugin (Quickshell/QML, Wayland).
  • macOS: a single-file Swift app that lives in the menu bar.

Try the demo pet

# Linux / DankMaterialShell
mkdir -p plugin/assets && cp pets/demo/atlas.png pets/demo/pet.json plugin/assets/
ln -s "$PWD/plugin" ~/.config/DankMaterialShell/plugins/ChibiMe
dms ipc call plugins enable chibiMe
dms ipc call chibiMe toggle

# macOS (needs the Xcode Command Line Tools)
swiftc -O mac/ChibiMe.swift -o chibi-me
./chibi-me                                     # pets/demo by default

Make your own

pip install pillow
export OPENROUTER_API_KEY=sk-or-...
python sprites.py hatch photo.jpg pets/me      # 5 image calls on OpenRouter, ~$0.27 if none fails, ~2 min
python sprites.py gif pets/me me.gif           # a demo GIF like the one above, to show it off
  • The photo becomes one chibi "anchor" (Gemini 3 Pro Image). The walk cycle and poses are drawn from that anchor by Qwen Image 3, which is 4x cheaper but refuses photos of real faces, so it only ever sees the drawing. Override with PET_ANCHOR_MODEL and PET_MODEL.
  • Every pose copies the anchor. If pets/me/raw/anchor.png came out wrong, delete it and run hatch again.
  • If a run dies on one sheet (slow upstream, timeout), just run it again: the anchor and every good sheet drawn from it are reused, so you only pay for what failed.
  • Check pets/me/contact.png for the whole sprite set.
  • Your photo is sent to OpenRouter and the model provider.
  • Certificate errors with python.org Python on macOS: SSL_CERT_FILE=/etc/ssl/cert.pem python sprites.py ...
  • iPhone/Mac photos are HEIC: sips -s format jpeg photo.heic --out photo.jpg, or pip install pillow-heif.

Then put atlas.png and pet.json into plugin/assets/ (Linux) or run ./chibi-me pets/me (macOS).

A pet for your pet, and couples

python sprites.py companion "a chubby grey tabby cat" pets/cat   # from text only, 3 calls, ~$0.10
mkdir -p plugin/assets/me plugin/assets/cat
cp pets/me/atlas.png pets/me/pet.json plugin/assets/me/
cp pets/cat/atlas.png pets/cat/pet.json plugin/assets/cat/
echo '["me", "cat"]' > plugin/assets/pets.json                  # the first chibi leads, companions follow it
  • A companion trails the first chibi, naps when she naps and can be grabbed and thrown too.
  • Two or more chibis (["me", "partner", "cat"]) walk up to each other and wave with hearts, or chase each other.
  • macOS: ./chibi-me plugin/assets reads the same pets.json, or list dirs: ./chibi-me pets/me pets/cat.

How it works

  1. Every generated sheet starts with the anchor's standing pose: the figure order names the poses and that first figure fixes the scale. Sheets are keyed out (chroma green), sliced and packed into a 512x512 atlas.
  2. The runtime is a small state machine: weighted random actions (walk, idle, wave, climb to the bar, sleep...), reactions to the cursor, gravity, drag and throw.
  3. The pet draws in a 128x128 window that moves around, so the compositor only blends that square per frame.

Linux: DankMaterialShell

Add the Chibi Me widget to your bar in Settings: click it to let the pets out or call them home.

The pets react to what DMS already knows, from its own services, with no polling:

When They
music plays (MPRIS) dance
battery is low slow down, sit and nap more
you plug in the charger wave
a notification pops up the leader turns and points at it
you are away for 2 min everyone falls asleep, and stretches when you are back
dms ipc call chibiMe toggle                    # out / home
dms ipc call chibiMe status                    # every pet's mode
dms ipc call chibiMe act hang                  # the leader: sit sleep stretch wave point dance walk drop
dms ipc call chibiMe react music               # fake the world: music quiet low ok charge notify idle wake meet

macOS

Left click its head in the menu bar to let the pets out or call them home, right click to quit. They nap when you are away and react to the battery; macOS has no public API for what music is playing or for other apps' notifications, so no dancing and no pointing there. Tested on macOS 26 (Apple Silicon) with Swift 6.4.

Tests and benchmark

python test_sprites.py        # keying, slicing, atlas, hatch and companion with a fake image model, GIF
node --test test_logic.js     # physics and moods of the QML runtime
swift mac/ChibiMe.swift       # on Linux: self-check of the Swift port's logic
python bench.py               # DMS runtime cost: CPU / GPU of quickshell and niri, from DRM fdinfo

License

Code: MIT. pets/demo/ and docs/demo.gif are AI drawings based on a photo by Georges Biard, licensed CC BY-SA 3.0, and are shared under the same license.

About

Turn any photo into a tiny chibi desktop pet. DankMaterialShell plugin (Wayland) and macOS menu bar app, sprites drawn via OpenRouter.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages