summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/config/dms.go
diff options
context:
space:
mode:
authorAlexanderCurl <alexc@alexc.hu>2026-04-18 17:46:06 +0100
committerAlexanderCurl <alexc@alexc.hu>2026-04-18 17:46:06 +0100
commit70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69 (patch)
treeab1123d4067c1b086dd6faa7ee4ea643236b565a /raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/config/dms.go
parent5d94c0a7d44a2255b81815a52a7056a94a39842d (diff)
downloadRaveOS-PKGBUILD-70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69.tar.gz
RaveOS-PKGBUILD-70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69.zip
Replaced file structures for themes in the correct format
Diffstat (limited to 'raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/config/dms.go')
-rw-r--r--raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/config/dms.go57
1 files changed, 57 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/config/dms.go b/raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/config/dms.go
new file mode 100644
index 0000000..7842fa5
--- /dev/null
+++ b/raveos-hyprland-theme/theme-data/DankMaterialShell/core/internal/config/dms.go
@@ -0,0 +1,57 @@
+package config
+
+import (
+ "fmt"
+ "os"
+ "path/filepath"
+ "strings"
+)
+
+func LocateDMSConfig() (string, error) {
+ var primaryPaths []string
+
+ configHome, err := os.UserConfigDir()
+ if err == nil && configHome != "" {
+ primaryPaths = append(primaryPaths, filepath.Join(configHome, "quickshell", "dms"))
+ }
+
+ // System data directories
+ dataDirs := os.Getenv("XDG_DATA_DIRS")
+ if dataDirs == "" {
+ dataDirs = "/usr/local/share:/usr/share"
+ }
+
+ for dir := range strings.SplitSeq(dataDirs, ":") {
+ if dir != "" {
+ primaryPaths = append(primaryPaths, filepath.Join(dir, "quickshell", "dms"))
+ }
+ }
+
+ // System config directories (fallback)
+ configDirs := os.Getenv("XDG_CONFIG_DIRS")
+ if configDirs == "" {
+ configDirs = "/etc/xdg"
+ }
+
+ for dir := range strings.SplitSeq(configDirs, ":") {
+ if dir != "" {
+ primaryPaths = append(primaryPaths, filepath.Join(dir, "quickshell", "dms"))
+ }
+ }
+
+ // Build search paths with secondary (monorepo) paths interleaved
+ var searchPaths []string
+ for _, path := range primaryPaths {
+ searchPaths = append(searchPaths, path)
+ searchPaths = append(searchPaths, filepath.Join(path, "quickshell"))
+ }
+
+ for _, path := range searchPaths {
+ shellPath := filepath.Join(path, "shell.qml")
+ if info, err := os.Stat(shellPath); err == nil && !info.IsDir() {
+ return path, nil
+ }
+ }
+
+ return "", fmt.Errorf("could not find DMS config (shell.qml) in any valid config path")
+}