From 66c012300a28a97f959808ed2e0f968c1e3601c0 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 8 Aug 2025 22:42:23 +1000 Subject: paths: better to string --- config/SessionConfig.qml | 4 ++-- utils/Paths.qml | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/SessionConfig.qml b/config/SessionConfig.qml index 22b926c..f65ec6d 100644 --- a/config/SessionConfig.qml +++ b/config/SessionConfig.qml @@ -4,10 +4,10 @@ JsonObject { property bool enabled: true property int dragThreshold: 30 property bool vimKeybinds: false - property Commands commands: Commands{} + property Commands commands: Commands {} property Sizes sizes: Sizes {} - + component Commands: JsonObject { property list logout: ["loginctl", "terminate-user", ""] property list shutdown: ["systemctl", "poweroff"] diff --git a/utils/Paths.qml b/utils/Paths.qml index 0e3ac3b..87d5a48 100644 --- a/utils/Paths.qml +++ b/utils/Paths.qml @@ -17,7 +17,12 @@ Singleton { readonly property url imagecache: `${cache}/imagecache` function stringify(path: url): string { - return path.toString().replace(/%20/g, " "); + let str = path.toString(); + if (str.startsWith("root:/")) + str = `file://${Quickshell.shellDir}/${str.slice(6)}`; + else if (str.startsWith("/")) + str = `file://${str}`; + return new URL(str).pathname; } function expandTilde(path: string): string { -- cgit v1.2.3-freya