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.1.tar.gz (10.5 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.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ghostty_yazi_flavor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6bfd8d3b3ad0c51971ad5f755c9b80bd5c213919f2f118e7f03090a27b136d75
MD5 f4dd782670750d12a3730d7137d413fa
BLAKE2b-256 1944b5d18f23799d930be7b7fd46c5c2d3e14fea361b1744c903d0807cb564be

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ghostty_yazi_flavor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 15efe6e95bdc67c95a5d0cc2c0536f6b390e9677300897c28e1d3678800f54dd
MD5 12784d663fbd21df0cbb67fd73ff8b87
BLAKE2b-256 288b2885162da1a2bb9f870ec7dc9a9cc773dd89a4650eebdba673235a78c548

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