summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-11 02:03:01 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-09-11 02:03:01 +1000
commit2832de18d71579383b400c1bf9ecbcb0ef54ce10 (patch)
tree62237ba1a81b243e5a1f2e3ae86d9fb9d802b4bf /modules
parentplugin: remove multimedia dep (diff)
downloadcaelestia-shell-2832de18d71579383b400c1bf9ecbcb0ef54ce10.tar.gz
caelestia-shell-2832de18d71579383b400c1bf9ecbcb0ef54ce10.tar.bz2
caelestia-shell-2832de18d71579383b400c1bf9ecbcb0ef54ce10.zip
launcher: sort apps by usage
Closes #588
Diffstat (limited to 'modules')
-rw-r--r--modules/launcher/services/Apps.qml47
1 files changed, 28 insertions, 19 deletions
diff --git a/modules/launcher/services/Apps.qml b/modules/launcher/services/Apps.qml
index 229bdae..b4b766d 100644
--- a/modules/launcher/services/Apps.qml
+++ b/modules/launcher/services/Apps.qml
@@ -2,13 +2,15 @@ pragma Singleton
import qs.config
import qs.utils
+import Caelestia
import Quickshell
-import QtQuick
Searcher {
id: root
function launch(entry: DesktopEntry): void {
+ appDb.incrementFrequency(entry.id);
+
if (entry.runInTerminal)
Quickshell.execDetached({
command: ["app2unit", "--", ...Config.general.apps.terminal, `${Quickshell.shellDir}/assets/wrap_term_launch.sh`, ...entry.command],
@@ -50,10 +52,10 @@ Searcher {
weights = [1];
if (!search.startsWith(`${prefix}t `))
- return query(search).map(e => e.modelData);
+ return query(search).map(e => e.entry);
}
- const results = query(search.slice(prefix.length + 2)).map(e => e.modelData);
+ const results = query(search.slice(prefix.length + 2)).map(e => e.entry);
if (search.startsWith(`${prefix}t `))
return results.filter(a => a.runInTerminal);
return results;
@@ -63,24 +65,31 @@ Searcher {
return keys.map(k => item[k]).join(" ");
}
- list: variants.instances
+ list: appDb.apps
useFuzzy: Config.launcher.useFuzzy.apps
- Variants {
- id: variants
-
- model: [...DesktopEntries.applications.values].filter(a => !Config.launcher.hiddenApps.includes(a.id)).sort((a, b) => a.name.localeCompare(b.name))
+ AppDb {
+ id: appDb
- QtObject {
- required property DesktopEntry modelData
- readonly property string id: modelData.id
- readonly property string name: modelData.name
- readonly property string desc: modelData.comment
- readonly property string execString: modelData.execString
- readonly property string wmClass: modelData.startupClass
- readonly property string genericName: modelData.genericName
- readonly property string categories: modelData.categories.join(" ")
- readonly property string keywords: modelData.keywords.join(" ")
- }
+ path: `${Paths.state}/apps.sqlite`
+ entries: DesktopEntries.applications.values.filter(a => !Config.launcher.hiddenApps.includes(a.id))
}
+
+ // Variants {
+ // id: variants
+
+ // model: [...DesktopEntries.applications.values].filter(a => !Config.launcher.hiddenApps.includes(a.id)).sort((a, b) => a.name.localeCompare(b.name))
+
+ // QtObject {
+ // required property DesktopEntry modelData
+ // readonly property string id: modelData.id
+ // readonly property string name: modelData.name
+ // readonly property string desc: modelData.comment
+ // readonly property string execString: modelData.execString
+ // readonly property string wmClass: modelData.startupClass
+ // readonly property string genericName: modelData.genericName
+ // readonly property string categories: modelData.categories.join(" ")
+ // readonly property string keywords: modelData.keywords.join(" ")
+ // }
+ // }
}