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:
@@ -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")
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user