SettingsWindow: allow tilde usage

This commit is contained in:
lysec
2025-10-12 21:13:52 +02:00
parent 427f87b320
commit d442f306c2
7 changed files with 31 additions and 13 deletions
+17
View File
@@ -375,6 +375,23 @@ Singleton {
}
}
// -----------------------------------------------------
// Function to preprocess paths by expanding "~" to user's home directory
function preprocessPath(path) {
if (typeof path !== "string" || path === "") {
return path
}
// Expand "~" to user's home directory
if (path.startsWith("~/")) {
return Quickshell.env("HOME") + path.substring(1)
} else if (path === "~") {
return Quickshell.env("HOME")
}
return path
}
// -----------------------------------------------------
// Public function to trigger immediate settings saving
function saveImmediate() {