Documentation
¶
Overview ¶
Package config carries the user-supplied YAML config that any tuilib component can consult. Today only the theme name lives here; as other packages grow user-tunable knobs (logview defaults, runner clear-screen, custom keymaps, custom palettes), their fields land on Config too.
The library never writes the file and never creates the directory — config is opt-in. A missing file is the steady state for users who haven't set anything; Load returns (Config{}, nil) in that case. Parse errors on a malformed file are surfaced so silent corruption doesn't mask itself.
Cross-package usage:
cfg, _ := config.Load() themes := theme.Resolve(theme.All(), "TUILIB_THEME") // already calls Load // later, hypothetically: lvOpts := logview.FromConfig(cfg) // reads cfg.Logview
Each consumer pulls just the fields it cares about; this package owns only the file shape and I/O.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Theme names a theme to use as the initial palette. Matched against
// theme.Theme.Name by theme.Resolve. Empty string disables the lookup.
Theme string `yaml:"theme"`
}
Config is the unmarshaled form of $XDG_CONFIG_HOME/tuilib/config.yaml. Unknown YAML keys are tolerated by yaml.Unmarshal so adding new fields is backwards-compatible.