1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -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

@@ -16,9 +16,9 @@ type DiscoveryConfig struct {
func DefaultDiscoveryConfig() *DiscoveryConfig {
var searchPaths []string
configHome := utils.XDGConfigHome()
if configHome != "" {
searchPaths = append(searchPaths, filepath.Join(configHome, "DankMaterialShell", "cheatsheets"))
configDir, err := os.UserConfigDir()
if err == nil && configDir != "" {
searchPaths = append(searchPaths, filepath.Join(configDir, "DankMaterialShell", "cheatsheets"))
}
configDirs := os.Getenv("XDG_CONFIG_DIRS")

View File

@@ -9,7 +9,6 @@ import (
"strings"
"github.com/AvengeMedia/DankMaterialShell/core/internal/keybinds"
"github.com/AvengeMedia/DankMaterialShell/core/internal/utils"
"github.com/sblinch/kdl-go"
"github.com/sblinch/kdl-go/document"
)
@@ -30,7 +29,11 @@ func NewNiriProvider(configDir string) *NiriProvider {
}
func defaultNiriConfigDir() string {
return filepath.Join(utils.XDGConfigHome(), "niri")
configDir, err := os.UserConfigDir()
if err != nil {
return ""
}
return filepath.Join(configDir, "niri")
}
func (n *NiriProvider) Name() string {