Skip to content

Theme

The theme file is ~/.drudge/theme.json. drg setup writes it when it is missing, with the theme it asks you for and no overrides. drg setup -y and input that is not a terminal take the system theme. After that the file is yours to edit.

When the file exists, drg setup asks again with the theme of the file preselected and writes the answer back into it. overrides, $schema and every other key stay as they are. drg setup -y and input that is not a terminal leave an existing file alone. A file that does not load, like broken JSON or an unknown theme name, stops drg setup with the error before any question is asked.

Schema

The file starts with "$schema": "./schema/theme.json", a path relative to the file. It points at ~/.drudge/schema/theme.json, the local copy of the schema that drg setup rewrites on every run. An editor with JSON schema support uses it to complete keys and flag wrong values.

Palettes

theme names one of the bundled palettes:

  • system uses the basic ANSI colors of your terminal and dim. It is the default.
  • nord, monokai, catppuccin-mocha and dracula use 24-bit colors.

A missing file or a missing theme key means system. An unknown theme name makes DRUDGE fall back to the default theme and print a warning.

Overrides

overrides maps a role to a #rrggbb color that replaces the color of the palette for that role. Every role you leave out keeps the color of the palette.

{
  "$schema": "./schema/theme.json",
  "theme": "nord",
  "overrides": {
    "error": "#FF5555"
  }
}

An override that is not a #rrggbb color is skipped. Every command prints a warning naming the role and the value, and uses the color of the palette for that role.

Keys

KeyTypeDefaultAllowedDescription
$schemastringJSON schema reference for configuration validation
themestring"system""system", "nord", "monokai", "catppuccin-mocha", "dracula"The color theme to use.
overridesobjectOptional per-role color overrides. Each value must be a 24-bit hex color in “#rrggbb” format. Unknown roles are silently ignored.
overrides.primarystringmatches ^#[0-9a-fA-F]{6}$Default text / main content color.
overrides.headingstringmatches ^#[0-9a-fA-F]{6}$Heading text color.
overrides.successstringmatches ^#[0-9a-fA-F]{6}$Success message color.
overrides.errorstringmatches ^#[0-9a-fA-F]{6}$Error message color.
overrides.warningstringmatches ^#[0-9a-fA-F]{6}$Warning message color.
overrides.infostringmatches ^#[0-9a-fA-F]{6}$Informational message color.
overrides.mutedstringmatches ^#[0-9a-fA-F]{6}$Muted / dimmed text color.
overrides.secondarystringmatches ^#[0-9a-fA-F]{6}$Secondary text color.
overrides.borderstringmatches ^#[0-9a-fA-F]{6}$Border / separator color.
overrides.pathstringmatches ^#[0-9a-fA-F]{6}$File path display color.
overrides.selectionstringmatches ^#[0-9a-fA-F]{6}$Background color of the highlighted row.
overrides.<key>stringmatches ^#[0-9a-fA-F]{6}$
Last updated on