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
ghostty-yazi-flavor status             # what's generated, is the watcher on

Change your Ghostty theme → run it again → restart yazi. The full grammar is generate (the default; takes --out <dir> and --ghostty <path>), install-watcher [--print], uninstall-watcher, and status.

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.2.0.tar.gz (12.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.2.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ghostty_yazi_flavor-0.2.0.tar.gz
  • Upload date:
  • Size: 12.6 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.2.0.tar.gz
Algorithm Hash digest
SHA256 2f908479be5ca41aad30ff370cbd17cfb7dbba1a3ae09b4a0f642ac09605b37c
MD5 63eb0006403c972c73759c7ac7460cc4
BLAKE2b-256 f6fc8f6aed8c91a0bcfe83ecccf987f4c8267171515a44bbba7b49e0f24183bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ghostty_yazi_flavor-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e26ba3d5a93b39181e66b7e386b9ff81105e3954ea11e281b615e1e91bdbd082
MD5 53abd585e126a686392b63773791e9f1
BLAKE2b-256 8252ee015163aa3303938568fff3a7ba50c1f45670024ca5ad02629c1f40c1c7

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