1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-26 06:22:50 -05:00

core: use stdlib for xdg dirs

This commit is contained in:
bbedward
2025-12-11 10:15:23 -05:00
parent 1c1cf866e2
commit 3a8d3ee515
9 changed files with 33 additions and 109 deletions

View File

@@ -12,6 +12,7 @@ import (
"strings"
"time"
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
"github.com/AvengeMedia/DankMaterialShell/core/internal/utils"
)
@@ -119,7 +120,12 @@ func GetOutputDir() string {
}
func getXDGPicturesDir() string {
userDirsFile := filepath.Join(utils.XDGConfigHome(), "user-dirs.dirs")
userConfigDir, err := os.UserConfigDir()
if err != nil {
log.Error("failed to get user config dir", "err", err)
return ""
}
userDirsFile := filepath.Join(userConfigDir, "user-dirs.dirs")
data, err := os.ReadFile(userDirsFile)
if err != nil {
return ""