summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-27 14:30:16 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-27 14:30:16 +1000
commitdaad6e44801f8727cc615259c18316a071ff8c77 (patch)
treea71424d32d87f78e2e8bb6dac22d25f72278f6ff /utils
parentinternal: use configDir -> shellDir (diff)
downloadcaelestia-shell-daad6e44801f8727cc615259c18316a071ff8c77.tar.gz
caelestia-shell-daad6e44801f8727cc615259c18316a071ff8c77.tar.bz2
caelestia-shell-daad6e44801f8727cc615259c18316a071ff8c77.zip
icons: use heuristicLookup
Diffstat (limited to 'utils')
-rw-r--r--utils/Icons.qml17
1 files changed, 2 insertions, 15 deletions
diff --git a/utils/Icons.qml b/utils/Icons.qml
index b95c369..e8e2bdb 100644
--- a/utils/Icons.qml
+++ b/utils/Icons.qml
@@ -103,10 +103,6 @@ Singleton {
"395": "snowing"
})
- readonly property var desktopEntrySubs: ({
- "gimp-3.0": "gimp"
- })
-
readonly property var categoryIcons: ({
WebBrowser: "web",
Printing: "print",
@@ -150,21 +146,12 @@ Singleton {
property string osIcon: ""
property string osName
- function getDesktopEntry(name: string): DesktopEntry {
- name = name.toLowerCase().replace(/ /g, "-");
-
- if (desktopEntrySubs.hasOwnProperty(name))
- name = desktopEntrySubs[name];
-
- return DesktopEntries.applications.values.find(a => a.id.toLowerCase() === name) ?? null;
- }
-
function getAppIcon(name: string, fallback: string): string {
- return Quickshell.iconPath(getDesktopEntry(name)?.icon, fallback);
+ return Quickshell.iconPath(DesktopEntries.heuristicLookup(name)?.icon, fallback);
}
function getAppCategoryIcon(name: string, fallback: string): string {
- const categories = getDesktopEntry(name)?.categories;
+ const categories = DesktopEntries.heuristicLookup(name)?.categories;
if (categories)
for (const [key, value] of Object.entries(categoryIcons))