Documentation
¶
Overview ¶
Package config handles loading user configuration from disk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
DarkTheme string `json:"dark_theme"` // cyber | matrix | dracula | nord
LightTheme string `json:"light_theme"` // clean | solarized
Telemetry *bool `json:"telemetry,omitempty"` // nil = enabled (opt-out default), false = disabled
ClientID string `json:"client_id,omitempty"` // random UUID for anonymous telemetry identity
}
Config holds persistent user preferences for unum.
func EnsureClientID ¶ added in v1.3.0
func EnsureClientID() Config
EnsureClientID loads the config, generates a client ID if missing, saves, and returns the config. If saving fails, the in-memory config is still returned with the generated ID.
func Load ¶
func Load() Config
Load reads the config file from the OS config directory. Returns defaults if the file is absent or malformed. Location: $XDG_CONFIG_HOME/unum/config.json (Linux/macOS)
%APPDATA%\unum\config.json (Windows)
func (Config) TelemetryEnabled ¶ added in v1.3.0
TelemetryEnabled reports whether telemetry should be active. Priority: DO_NOT_TRACK=1 > UNUM_NO_TELEMETRY=1 > config file > default (true).
Click to show internal directories.
Click to hide internal directories.