adding init program

This commit is contained in:
lwoodard
2026-04-13 12:45:41 -06:00
parent 639a08a808
commit 91b7028382
12 changed files with 1035 additions and 8 deletions

View File

@@ -36,6 +36,16 @@ type KeyConfig struct {
Params map[string]string `yaml:"params"`
}
// DefaultConfigPath returns the default config file path, respecting XDG_CONFIG_HOME.
func DefaultConfigPath() string {
base := os.Getenv("XDG_CONFIG_HOME")
if base == "" {
home, _ := os.UserHomeDir()
base = filepath.Join(home, ".config")
}
return filepath.Join(base, "streamdeck-go", "config.yaml")
}
// ModulesPath returns the path to the modules.yaml file next to the given config file.
func ModulesPath(cfgPath string) string {
return filepath.Join(filepath.Dir(cfgPath), "modules.yaml")