From d299d1c7c7c66394c6a260451410f87b6559ac9c Mon Sep 17 00:00:00 2001 From: VERSE Date: Tue, 4 Aug 2026 23:51:59 +0700 Subject: [PATCH] refactor(path): use XDG config for all platforms (#119) closes #112 Replace `os.UserConfigDir()` with explicit `~/.config` fallback to align macOS, Linux, and other platforms on same config location Respects `XDG_CONFIG_HOME` if set, otherwise uses `~/.config/iris/` --- internal/config/paths.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/config/paths.go b/internal/config/paths.go index 257fcde..f3e98df 100644 --- a/internal/config/paths.go +++ b/internal/config/paths.go @@ -10,11 +10,11 @@ func ConfigPath() (string, error) { if configHome != "" { return filepath.Join(configHome, "iris", "config.toml"), nil } - dir, err := os.UserConfigDir() + home, err := os.UserHomeDir() if err != nil { return "", err } - return filepath.Join(dir, "iris", "config.toml"), nil + return filepath.Join(home, ".config", "iris", "config.toml"), nil } func ThemePath() (string, error) { @@ -22,11 +22,11 @@ func ThemePath() (string, error) { if configHome != "" { return filepath.Join(configHome, "iris", "theme.toml"), nil } - dir, err := os.UserConfigDir() + home, err := os.UserHomeDir() if err != nil { return "", err } - return filepath.Join(dir, "iris", "theme.toml"), nil + return filepath.Join(home, ".config", "iris", "theme.toml"), nil } func StatePath() (string, error) {