From 38373aa5f216f3913c00577bc71eee5a1b26c6fe Mon Sep 17 00:00:00 2001 From: Walid Salah Date: Mon, 20 Apr 2026 15:15:29 +0200 Subject: [PATCH] Fix: Expand tilde from config paths (#2242) * Expand tilde to the home directory for paths from config * Remove extra line --- quickshell/Common/Paths.qml | 4 +++- quickshell/Common/Theme.qml | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/quickshell/Common/Paths.qml b/quickshell/Common/Paths.qml index ee50cefb..3d728b87 100644 --- a/quickshell/Common/Paths.qml +++ b/quickshell/Common/Paths.qml @@ -23,7 +23,9 @@ Singleton { } function expandTilde(path: string): string { - return strip(path.replace("~", stringify(root.home))); + if (!path.startsWith("~")) + return path; + return strip(root.home) + path.substring(1); } function shortenHome(path: string): string { diff --git a/quickshell/Common/Theme.qml b/quickshell/Common/Theme.qml index 7441f191..69b5f326 100644 --- a/quickshell/Common/Theme.qml +++ b/quickshell/Common/Theme.qml @@ -1100,7 +1100,7 @@ Singleton { } function loadCustomThemeFromFile(filePath) { - customThemeFileView.path = filePath; + customThemeFileView.path = Paths.expandTilde(filePath); } function reloadCustomThemeVariant() { @@ -1749,6 +1749,7 @@ Singleton { FileView { id: customThemeFileView + blockLoading: false watchChanges: currentTheme === "custom" function parseAndLoadTheme() {