Theme/Skin System Documentation

Overview

The flux9s theme system allows you to customize the appearance of the TUI by loading color schemes from YAML files. Themes follow the k9s skin format for familiarity and compatibility.

How It Works

Theme Resolution Order

When loading a theme, flux9s checks in this order:

  1. User Skins Directory: $XDG_DATA_HOME/flux9s/skins/{name}.yaml (default: ~/.local/share/flux9s/skins/)
  2. System Skins Directory: $XDG_CONFIG_HOME/flux9s/skins/{name}.yaml (default: ~/.config/flux9s/skins/)
  3. Built-in Default: Falls back to hardcoded default theme

Setting a Theme

Via Configuration File

Edit ~/.config/flux9s/config.yaml:

ui:
  skin: dracula

Or use the CLI:

flux9s config set ui.skin dracula

Via Environment Variable

export FLUX9S_SKIN=dracula
flux9s

Via TUI Command

While in the TUI, type:

:skin dracula

This changes the theme immediately (temporary, doesn’t persist to config file).

Theme File Format

Themes use k9s-style YAML format:

k9s:
  body:
    fg: "#ffffff" # Foreground color
    bg: "#000000" # Background color
    logo: "#00ff00" # Logo/ASCII art color

  frame:
    border:
      fg: "#00ffff" # Border color
    menu:
      fg: "#ffffff"
      bg: "#000000"
      key: "#00ff00" # Keybinding color
    crumbs:
      fg: "#ffff00"
      active: "#ffffff"
    status:
      new: "#00ff00" # Success/ready color
      error: "#ff0000" # Error color
    title:
      fg: "#ffffff"
      bg: "#000000"

  views:
    table:
      fg: "#ffffff"
      bg: "#000000"
      cursor:
        fg: "#000000"
        bg: "#ffffff"
      header:
        fg: "#ffffff"
        bg: "#000000"
    yaml:
      key: "#00ffff"
      value: "#ffffff"
    logs:
      fg: "#ffffff"
      bg: "#000000"

Color Format Support

Color Mapping

The k9s skin format is mapped to flux9s Theme fields:

Example Themes

Default Theme

The default theme is built-in and uses:

Creating Custom Themes

  1. Create a YAML file in ~/.local/share/flux9s/skins/ or ~/.config/flux9s/skins/
  2. Name it {theme-name}.yaml
  3. Use the k9s format shown above
  4. Set it with flux9s config set ui.skin {theme-name} or :skin {theme-name} in TUI

Implementation Details

Code Structure

Key Functions

Current Status

Implemented:

🚧 Future Enhancements:

Troubleshooting

Theme not loading?

Colors not applying correctly?