Skip to main content

Generate a yazi flavor from your active Ghostty theme — hover bars and code-preview highlighting that actually match your terminal.

Project description

ghostty-yazi-flavor

PyPI

Generate a yazi flavor from your active Ghostty theme — so yazi's hover bars, mode pills, and code-preview syntax highlighting actually match your terminal instead of fighting it.

Why

Yazi's default theme follows your terminal's 16-color ANSI palette, which gets you most of the way — but two things don't follow it:

  1. Code-preview highlighting uses syntect's built-in default theme, which ignores your palette entirely. On most themes that means a wall of mismatched color over the wrong background.
  2. Hover indicators use reverse-video: the hovered row becomes a solid block of its own text color. If your theme keeps something loud in its blue slot, every hover is a neon bar.

Hand-made flavors fix this for popular themes (catppuccin, dracula, …). For the other ~450 themes Ghostty ships with — or your own custom one — this tool generates the flavor from whatever theme is actually active.

How it works

It runs ghostty +show-config, which prints the resolved config with the active theme's palette already applied (built-in themes, custom themes in ~/.config/ghostty/themes, includes — all handled by Ghostty itself). From those 16 colors + background/foreground/selection it writes:

~/.config/yazi/flavors/ghostty.yazi/
├── flavor.toml    # hover bars, mode pills, tabs, borders — palette-derived
└── tmtheme.xml    # code-preview highlighting built from your actual colors

The flavor is deliberately partial: everything yazi's preset already gets right by following ANSI colors is left alone; only the spots that ignore the palette (or follow it badly) are overridden.

Install

uv tool install ghostty-yazi-flavor
# or: pipx install ghostty-yazi-flavor

Then point yazi at the flavor in ~/.config/yazi/theme.toml:

[flavor]
dark = "ghostty"
light = "ghostty"

Use

ghostty-yazi-flavor                    # regenerate from the current theme

Change your Ghostty theme → run it again → restart yazi. Options: --out <dir>, --ghostty <path>, --version.

Automatic regeneration

ghostty-yazi-flavor install-watcher    # set it and forget it

Installs a file watcher on your Ghostty config (and custom themes directory, if you have one), so the flavor regenerates on every config write — including saves that you follow with Ghostty's reload-config keybinding:

  • macOS: a launchd LaunchAgent using WatchPaths — event-driven, no polling, no dependencies. Logs to ~/Library/Logs/ghostty-yazi-flavor.log.
  • Linux: systemd user units (a .path watching the config + a oneshot .service).

--print shows exactly what would be installed without touching anything; ghostty-yazi-flavor uninstall-watcher removes it cleanly.

Non-systemd Linux: run a watch loop under your supervisor of choice (supervisord, runit, …):

inotifywait -m -e close_write ~/.config/ghostty/config | while read -r _; do
  ghostty-yazi-flavor
done

chezmoi: if your Ghostty config is managed there, skip the watcher and hook regeneration to the source of truth instead:

# .chezmoiscripts/run_onchange_after_sync-yazi-flavor.sh.tmpl
#!/bin/bash
set -euo pipefail
# ghostty config hash: {{ include "dot_config/ghostty/config" | sha256sum }}
"$HOME/.local/bin/ghostty-yazi-flavor"

tmux note

If yazi renders colorless inside tmux, the pane environment is missing COLORTERM. Add to your tmux.conf:

set -ga update-environment COLORTERM

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghostty_yazi_flavor-0.1.0.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghostty_yazi_flavor-0.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file ghostty_yazi_flavor-0.1.0.tar.gz.

File metadata

  • Download URL: ghostty_yazi_flavor-0.1.0.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ghostty_yazi_flavor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0caeb4b1f513548fcc597abd2437b4f3a12569a269cab78d913b6ae49af2016
MD5 eed4d68e541ad33bde84bae2d0dffbd9
BLAKE2b-256 4851a2ac67c0994e0ff711d2f423e1ff5f7a1eb963f905f88cd4f58bb26a2de8

See more details on using hashes here.

File details

Details for the file ghostty_yazi_flavor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ghostty_yazi_flavor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ghostty_yazi_flavor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3fdd29c4fc6845bbd9e6f514f20dc9e61f87a412190e3ce2ae73a89bf24f467c
MD5 7f4d251f1c8198dd430fabc23820c142
BLAKE2b-256 27cdc77fc61f3c46b480a3533c742a225f760c7c7f501f476b915e339b895f87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page