app launcher

This commit is contained in:
Zacharias-Brohn
2025-11-10 01:40:56 +01:00
parent b2a270ed0b
commit 6aedefc4d7
11 changed files with 2441 additions and 31 deletions
+44
View File
@@ -0,0 +1,44 @@
pragma Singleton
import Caelestia
import Quickshell
import Quickshell.Io
Searcher {
id: root
readonly property string home: Quickshell.env("HOME")
function launch(entry: DesktopEntry): void {
appDb.incrementFrequency(entry.id);
console.log( "Search command:", entry.command );
Quickshell.execDetached({
command: ["app2unit", "--", ...entry.command],
workingDirectory: entry.workingDirectory
});
}
function search(search: string): list<var> {
keys = ["name"];
weights = [1];
const results = query(search).map(e => e.entry);
return results;
}
function selector(item: var): string {
return keys.map(k => item[k]).join(" ");
}
list: appDb.apps
useFuzzy: true
AppDb {
id: appDb
path: `${root.home}/.local/share/z-cast-qt/apps.sqlite`
entries: DesktopEntries.applications.values
}
}