Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Theming datui from your system

datui can follow a theme generated by something else on your machine — a desktop theme manager, chezmoi, home-manager, or a dotfiles repo — through import. It detects no particular system; you point import at the file yours generates.

Light and dark terminals

Some colours (header fills, row striping, borders, dim text) sit near the terminal background rather than matching it, and resolve to fixed shades. A set tuned for a dark terminal is unreadable on a light one.

[theme]
mode = "auto"   # "auto" (default), "dark", or "light"

auto reads COLORFGBG and falls back to dark. Alacritty, Kitty and Ghostty do not set it, so on a light colour scheme in those terminals, set mode = "light".

Colours under [theme.colors] override whichever set mode chooses.

Omarchy

Omarchy renders per-app theme files from templates on omarchy theme set. datui ships one.

  1. Install the template:

    mkdir -p ~/.config/omarchy/themed
    cp contrib/omarchy/datui.toml.tpl ~/.config/omarchy/themed/
    
  2. Import the file Omarchy will generate:

    # ~/.config/datui/config.toml
    import = ["~/.local/state/omarchy/current/theme/datui.toml"]
    
  3. Apply a theme:

    omarchy theme set tokyo-night
    

The template sets theme.mode from the theme’s own polarity, so light themes get light chrome. A theme switch takes effect the next time datui starts; a running instance keeps the theme it launched with.

Overriding colours

Your own config.toml wins over anything imported:

import = ["~/.local/state/omarchy/current/theme/datui.toml"]

[theme.colors]
int_col = "#ff8800"     # applies on every theme

A colour set to the same string as datui’s default will not override an import — see the caveat.

Overriding one theme only

Add a second import, and a file in that theme’s directory:

# ~/.config/datui/config.toml
import = [
  "~/.local/state/omarchy/current/theme/datui.toml",
  "~/.local/state/omarchy/current/theme/datui.override.toml",
]
# ~/.config/omarchy/themes/osaka-jade/datui.override.toml
[theme.colors]
int_col   = "#ff8800"
float_col = "#ff00ff"

Omarchy copies your theme directory into the theme state directory before rendering templates, so the file arrives untouched. Themes without one lack the file, and datui skips a missing import with a warning on stderr.

Name it datui.override.toml. A file named datui.toml replaces the generated file rather than layering onto it, dropping every colour it does not restate.

What changes

Backgrounds, borders, header fills and row striping follow the theme.

Column-type colours will look much as they did before. datui’s defaults for those are ANSI names, which your terminal already resolves from the same theme. On near-monochrome themes several column types look alike; the per-theme override above is the way out.

Other systems

Only the paths above are Omarchy-specific:

import = ["~/.local/share/mytheme/datui.toml"]

The imported file uses datui’s config format and may set any section, not just [theme.colors].

See Also