package config import ( "os" "path/filepath" ) // DefaultConfigPath returns $XDG_CONFIG_HOME/teabot/config.yaml // (default ~/.config/teabot/config.yaml). func DefaultConfigPath() string { base := os.Getenv("XDG_CONFIG_HOME") if base == "" { home, _ := os.UserHomeDir() base = filepath.Join(home, ".config") } return filepath.Join(base, AppName, "config.yaml") } // DefaultStateDir returns $XDG_STATE_HOME/teabot // (default ~/.local/state/teabot). func DefaultStateDir() string { base := os.Getenv("XDG_STATE_HOME") if base == "" { home, _ := os.UserHomeDir() base = filepath.Join(home, ".local", "state") } return filepath.Join(base, AppName) } // StateDirOrDefault resolves the effective state directory for the config. func (c *Config) StateDirOrDefault() string { if c.StateDir != "" { return c.StateDir } return DefaultStateDir() }