formatter

This commit is contained in:
Zacharias-Brohn
2026-02-24 23:20:11 +01:00
parent 40cd984b6d
commit d56a0260fb
202 changed files with 15037 additions and 15352 deletions
+34 -33
View File
@@ -7,45 +7,46 @@ import Quickshell
import QtQuick
Searcher {
id: root
id: root
function transformSearch(search: string): string {
return search.slice(Config.launcher.actionPrefix.length);
}
function transformSearch(search: string): string {
return search.slice(Config.launcher.actionPrefix.length);
}
list: variants.instances
useFuzzy: Config.launcher.useFuzzy.actions
list: variants.instances
useFuzzy: Config.launcher.useFuzzy.actions
Variants {
id: variants
Variants {
id: variants
model: Config.launcher.actions.filter(a => (a.enabled ?? true))
model: Config.launcher.actions.filter(a => (a.enabled ?? true))
Action {}
}
Action {
}
}
component Action: QtObject {
required property var modelData
readonly property string name: modelData.name ?? qsTr("Unnamed")
readonly property string desc: modelData.description ?? qsTr("No description")
readonly property string icon: modelData.icon ?? "help_outline"
readonly property list<string> command: modelData.command ?? []
readonly property bool enabled: modelData.enabled ?? true
readonly property bool dangerous: modelData.dangerous ?? false
component Action: QtObject {
readonly property list<string> command: modelData.command ?? []
readonly property bool dangerous: modelData.dangerous ?? false
readonly property string desc: modelData.description ?? qsTr("No description")
readonly property bool enabled: modelData.enabled ?? true
readonly property string icon: modelData.icon ?? "help_outline"
required property var modelData
readonly property string name: modelData.name ?? qsTr("Unnamed")
function onClicked(list: AppList): void {
if (command.length === 0)
return;
function onClicked(list: AppList): void {
if (command.length === 0)
return;
if (command[0] === "autocomplete" && command.length > 1) {
list.search.text = `${Config.launcher.actionPrefix}${command[1]} `;
} else if (command[0] === "setMode" && command.length > 1) {
list.visibilities.launcher = false;
Colours.setMode(command[1]);
} else {
list.visibilities.launcher = false;
Quickshell.execDetached(command);
}
}
}
if (command[0] === "autocomplete" && command.length > 1) {
list.search.text = `${Config.launcher.actionPrefix}${command[1]} `;
} else if (command[0] === "setMode" && command.length > 1) {
list.visibilities.launcher = false;
Colours.setMode(command[1]);
} else {
list.visibilities.launcher = false;
Quickshell.execDetached(command);
}
}
}
}