config

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDataDir     = "~/.config/atria"
	DefaultMonitorDir  = "/tmp/atria-monitors"
	DefaultCacheTTL    = 5
	DefaultTmuxSession = ""
	DefaultPtyCols     = 120
	DefaultPtyRows     = 40
)

Default values for configuration fields.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

DefaultPath returns the default configuration file path.

Types

type Config

type Config struct {
	WatchDirs    []string `toml:"watch_dirs"`
	TmuxPath     string   `toml:"tmux_path"`
	TmuxSession  string   `toml:"tmux_session"`
	KittenPath   string   `toml:"kitten_path"`
	WezTermPath  string   `toml:"wezterm_path"`
	DataDir      string   `toml:"data_dir"`
	MonitorDir   string   `toml:"monitor_dir"`
	CacheTTL     int      `toml:"cache_ttl"`
	DefaultAgent string   `toml:"default_agent"`
	LaunchDir    string   `toml:"launch_dir"`
	PtyCols      int      `toml:"pty_cols"`
	PtyRows      int      `toml:"pty_rows"`
	FocusMode    string   `toml:"focus_mode"`

	UpdateCheck  *bool    `toml:"update_check"`
	Integrations []string `toml:"integrations"` // ["iterm2", "tmux"]
}

Config holds the application configuration parsed from a TOML file.

func Load

func Load(path string) (*Config, error)

Load reads configuration from the given TOML file path. If the file does not exist, a Config with default values is returned without an error.

func (*Config) Save

func (cfg *Config) Save(path string) error

Save writes the config to the given TOML file path with help comments. Fields at default values are written as comments. Non-default values are written uncommented. Creates parent directories if needed.

func (*Config) UpdateCheckEnabled added in v0.3.0

func (c *Config) UpdateCheckEnabled() bool

UpdateCheckEnabled returns whether the upgrade check is enabled. Defaults to true when not explicitly set.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL