diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-07-19 14:25:39 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-07-19 14:25:39 +1000 |
| commit | ce26c8a75460948bccf412b3c559ea9a5777131f (patch) | |
| tree | 3ad3aed7243298f27d85f50434f0619e7eb34f3d /services | |
| parent | readme: update config example (diff) | |
| download | caelestia-shell-ce26c8a75460948bccf412b3c559ea9a5777131f.tar.gz caelestia-shell-ce26c8a75460948bccf412b3c559ea9a5777131f.tar.bz2 caelestia-shell-ce26c8a75460948bccf412b3c559ea9a5777131f.zip | |
feat: fzf-like search instead of fuzzy
Also add license for fuzzysort lib
Diffstat (limited to 'services')
| -rw-r--r-- | services/Apps.qml | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/services/Apps.qml b/services/Apps.qml index 49b48fe..b8ec38e 100644 --- a/services/Apps.qml +++ b/services/Apps.qml @@ -1,25 +1,12 @@ pragma Singleton -import "root:/utils/scripts/fuzzysort.js" as Fuzzy +import qs.utils import Quickshell -Singleton { +Searcher { id: root - readonly property list<DesktopEntry> list: DesktopEntries.applications.values.filter(a => !a.noDisplay).sort((a, b) => a.name.localeCompare(b.name)) - readonly property list<var> preppedApps: list.map(a => ({ - name: Fuzzy.prepare(a.name), - comment: Fuzzy.prepare(a.comment), - entry: a - })) - - function fuzzyQuery(search: string): var { // Idk why list<DesktopEntry> doesn't work - return Fuzzy.go(search, preppedApps, { - all: true, - keys: ["name", "comment"], - scoreFn: r => r[0].score > 0 ? r[0].score * 0.9 + r[1].score * 0.1 : 0 - }).map(r => r.obj.entry); - } + list: DesktopEntries.applications.values.filter(a => !a.noDisplay).sort((a, b) => a.name.localeCompare(b.name)) function launch(entry: DesktopEntry): void { if (entry.runInTerminal) |