Added a feature to display Pokemon sprites overlaid in the center of panes when a keybinding is held.
- Source: krabby repository
- Location:
/doc/code/hexa/src/sprites/regular/- 1,152 regular Pokemon spritesshiny/- 1,152 shiny Pokemon sprites
- Format: ANSI-colored text files (terminal-friendly)
- Coverage: All generations with variants (Mega, Gigantamax, regional forms)
- Sprite state is managed per pane via
PokemonState - Implementation lives in
src/modules/popup/widgets/pokemon.zig - Sprites are loaded via embedded sprite assets and rendered as terminal cells
- Added
drawSpriteOverlay()toRenderer(src/modules/multiplexer/render.zig) - Parses ANSI color codes (24-bit RGB)
- Centers sprite in pane viewport
- Renders on top of pane content but below overlays
- Handles SGR (Select Graphic Rendition) escape sequences
- Added
sprite_toggletoBindActionenum (src/core/config.zig) - Handler in
src/modules/multiplexer/keybinds.zig - Works for both split panes and floating panes
- Automatically loads a random Pokemon sprite
- Added
sprite_statefield toPanestruct - Initialized/cleaned up with pane lifecycle
- Per-pane sprite state (each pane can have its own sprite)
Edit ~/.config/hexe/init.lua and add to mux.input.binds:
{ on = "press", mods = { hx.mod.ctrl, hx.mod.alt }, key = "p", action = { type = hx.action.sprite_toggle } },Or use any key combination you prefer:
{ on = "hold", hold_ms = 400, mods = { hx.mod.ctrl, hx.mod.alt }, key = "s", action = { type = hx.action.sprite_toggle } },- Press the keybinding (e.g.,
Ctrl+Alt+P) - A random Pokemon sprite appears in the center of the focused pane
- Press again to toggle it off
Example keybindings you could use:
-- Quick toggle
{ on = "press", mods = { hx.mod.ctrl, hx.mod.alt }, key = "p", action = { type = hx.action.sprite_toggle } },
-- Hold to show (release to hide)
{ on = "hold", hold_ms = 400, mods = { hx.mod.ctrl, hx.mod.alt }, key = "s", action = { type = hx.action.sprite_toggle } },
-- Repeat-friendly toggle
{ on = "repeat", mods = { hx.mod.ctrl, hx.mod.alt }, key = "p", action = { type = hx.action.sprite_toggle } },- Total: 1,152 regular + 1,152 shiny variants
- Includes: All Pokemon from Gen 1-9 plus special forms:
- Mega Evolutions (e.g.,
charizard-mega-x) - Gigantamax forms (e.g.,
pikachu-gmax) - Regional variants (e.g.,
vulpix-alola,meowth-galar) - Gender variants (e.g.,
nidoran-f,nidoran-m)
- Mega Evolutions (e.g.,
Sample sprites available:
pikachu, charizard, mewtwo, bulbasaur, squirtle, gengar, dragonite,
lapras, snorlax, eevee, mew, umbreon, espeon, lucario, garchomp,
rayquaza, kyogre, groudon, dialga, palkia, arceus, and many more!
- Sprites are loaded on-demand when toggled
- Cached in pane's
sprite_stateuntil pane is destroyed - Random Pokemon name generated using
core.ipc.generatePaneName() - Falls back to Pikachu if loading fails
- Sprites are ANSI-colored text with 24-bit RGB
- Parsed and rendered to cell buffer
- Centered in pane using visual width calculation
- Supports Unicode box-drawing characters (▀, ▄)
- Maintains color codes for authentic Pokemon appearance
- Sprites are text-based, very lightweight
- No external image libraries required
- Renders at terminal refresh rate
- Minimal memory overhead per pane
- Specify which Pokemon to show in keybinding config
- Shiny variant toggle
- Sprite tied to pane name (e.g., pane named "pikachu" shows Pikachu)
- Animation support (sprite cycling)
- Custom sprite directory support
- Sprite browser/picker overlay
src/core/config.zig- Addedsprite_toggleactionsrc/modules/multiplexer/pane.zig- Added sprite state to panessrc/modules/popup/widgets/pokemon.zig- Sprite state and loadingsrc/modules/multiplexer/loop_render.zig- Integrated sprite overlay renderingsrc/modules/multiplexer/keybinds_actions.zig- Sprite toggle action handlersrc/sprites/- Pokemon sprite assets (1,152 × 2)
- Pokemon sprites from krabby
- Original sprites from PokéSprite
- Converted to Unicode using pokemon-generator-scripts
- Pokemon data from PokéAPI
Gotta catch 'em all! 🎮✨