diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-09 21:02:24 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-09 21:02:24 +1000 |
| commit | 5b81104ffa22465e8f97a4d625e1a151c5d50c2f (patch) | |
| tree | afa1047b6d811a05acef112877ae43a9a0025760 /utils | |
| parent | plugin/service: remove zero ref warning (diff) | |
| download | caelestia-shell-5b81104ffa22465e8f97a4d625e1a151c5d50c2f.tar.gz caelestia-shell-5b81104ffa22465e8f97a4d625e1a151c5d50c2f.tar.bz2 caelestia-shell-5b81104ffa22465e8f97a4d625e1a151c5d50c2f.zip | |
bar/tray: add icon subs
Usage: array of { id, image | icon }
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/Icons.qml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/Icons.qml b/utils/Icons.qml index 76eef43..45c1537 100644 --- a/utils/Icons.qml +++ b/utils/Icons.qml @@ -1,5 +1,6 @@ pragma Singleton +import qs.config import Quickshell import Quickshell.Services.Notifications @@ -205,4 +206,16 @@ Singleton { return "monitor_heart"; return name[0].toUpperCase(); } + + function getTrayIcon(id: string, icon: string): string { + for (const sub of Config.bar.tray.iconSubs) + if (sub.id === id) + return sub.image ? Qt.resolvedUrl(sub.image) : Quickshell.iconPath(sub.icon); + + if (icon.includes("?path=")) { + const [name, path] = icon.split("?path="); + icon = Qt.resolvedUrl(`${path}/${name.slice(name.lastIndexOf("/") + 1)}`); + } + return icon; + } } |