diff options
Diffstat (limited to '')
| -rw-r--r-- | utils/Paths.qml | 3 | ||||
| -rw-r--r-- | utils/SysInfo.qml | 18 |
2 files changed, 18 insertions, 3 deletions
diff --git a/utils/Paths.qml b/utils/Paths.qml index 3b7e84f..8350fb1 100644 --- a/utils/Paths.qml +++ b/utils/Paths.qml @@ -19,7 +19,6 @@ Singleton { readonly property string imagecache: `${cache}/imagecache` readonly property string notifimagecache: `${imagecache}/notifs` readonly property string wallpaper: Quickshell.env("CAELESTIA_WALLPAPER") || absolutePath(Config.paths.wallpaper) - readonly property string face: Quickshell.env("CAELESTIA_FACE") || absolutePath(Config.paths.face) readonly property string libdir: Quickshell.env("CAELESTIA_LIB_DIR") || "/usr/lib/caelestia" function toLocalFile(path: url): string { @@ -28,7 +27,7 @@ Singleton { } function absolutePath(path: string): string { - return toLocalFile(path.replace("~", home)); + return toLocalFile(path.replace(/~|(\$({?)HOME(}?))+/, home)); } function shortenHome(path: string): string { diff --git a/utils/SysInfo.qml b/utils/SysInfo.qml index ab2699d..19aa4a7 100644 --- a/utils/SysInfo.qml +++ b/utils/SysInfo.qml @@ -1,5 +1,7 @@ pragma Singleton +import qs.config +import qs.utils import Quickshell import Quickshell.Io import QtQuick @@ -34,13 +36,27 @@ Singleton { root.osIdLike = fd("ID_LIKE").split(" "); const logo = Quickshell.iconPath(fd("LOGO"), true); - if (logo) { + if (Config.general.logo === "caelestia") { + root.osLogo = Qt.resolvedUrl(`${Quickshell.shellDir}/assets/logo.svg`); + root.isDefaultLogo = true; + } else if (Config.general.logo) { + root.osLogo = Quickshell.iconPath(Config.general.logo, true) || "file://" + Paths.absolutePath(Config.general.logo); + root.isDefaultLogo = false; + } else if (logo) { root.osLogo = logo; root.isDefaultLogo = false; } } } + Connections { + target: Config.general + + function onLogoChanged(): void { + osRelease.reload(); + } + } + Timer { running: true repeat: true |