launcher: fuzzy search

This commit is contained in:
end-4
2025-05-03 15:49:01 +02:00
parent 1beb723cf3
commit 4a44d78389
6 changed files with 730 additions and 16 deletions
@@ -294,11 +294,7 @@ Item { // Wrapper
// Add filtered application entries
result = result.concat(
DesktopEntries.applications.values
.filter((entry) => {
if (root.searchingText == "") return false
return entry.name.toLowerCase().includes(root.searchingText.toLowerCase())
})
AppSearch.fuzzyQuery(root.searchingText)
.map((entry) => {
entry.clickActionName = "Launch";
entry.type = "App"
@@ -322,17 +318,6 @@ Item { // Wrapper
});
}
}
// Qalc math result
result.push({
name: root.mathResult,
clickActionName: "Copy",
type: qsTr("Math result"),
fontType: "monospace",
materialSymbol: 'calculate',
execute: () => {
Hyprland.dispatch(`exec wl-copy '${root.mathResult}'`)
}
});
// Run command
result.push({
name: searchingText,
@@ -344,6 +329,17 @@ Item { // Wrapper
executor.executeCommand(searchingText.startsWith('sudo') ? `${ConfigOptions.apps.terminal} fish -C '${root.searchingText}'` : root.searchingText);
}
});
// Qalc math result
result.push({
name: root.mathResult,
clickActionName: "Copy",
type: qsTr("Math result"),
fontType: "monospace",
materialSymbol: 'calculate',
execute: () => {
Hyprland.dispatch(`exec wl-copy '${root.mathResult}'`)
}
});
// Web search
result.push({
name: root.searchingText,