Skip to content

[Feature Request] ANSI colours support for tinty #27

@screwyprof

Description

@screwyprof

ANSI colours support for tinty

When using tinty with ANSI colours, it expects theme-specific files in the directory specified by themes-dir. However, for ANSI colours we only have a single ansi.sh file that works for all themes.

Current behavior

When trying to use ANSI colours with tinty:

[[items]]
name = "fzf"
path = "/path/to/tinted-fzf"
themes-dir = "ansi"
hook = "cp -f %f ~/.config/fzf/colors.sh && source ~/.config/fzf/colors.sh"

It fails with:

❯ tinty apply base16-catppuccin-frappe
Theme does not exists for fzf in /Users/happygopher/.local/share/tinted-theming/tinty/repos/fzf/ansi. Try running `tinty update` or submit an issue on https://github.com/tinted-theming/tinty

Desired behaviour

Since ANSI colours are theme-agnostic (they use terminal colours), it would be helpful to:

  1. Either support a special case in tinty for ANSI colors
  2. Or provide theme-specific symlinks to ansi.sh in the repo

Current workaround

With modified config:

[[items]]
name = "fzf"
path = "${config.xdg.dataHome}/tinted-theming/tinty/repos/fzf"
themes-dir = "ansi-sh"
hook = "cp -f %f ~/.config/fzf/colors.sh && source ~/.config/fzf/colors.sh"

I create symlinks for each theme name pointing to ansi.sh:

mkdir -p ansi-sh/
cd ansi-sh/

for theme in ../sh/base16-.sh ../sh/base24-.sh; do
  name=$(basename "$theme")
  ln -s ../ansi/ansi.sh "$name"
done

This works but feels like it could be handled more elegantly at the tinty or repo level.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions