adding init program
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user