86 lines
2.4 KiB
QML
86 lines
2.4 KiB
QML
pragma Singleton
|
|
|
|
import ".."
|
|
import qs.config
|
|
import qs.services
|
|
import qs.util
|
|
import Quickshell
|
|
import QtQuick
|
|
|
|
Searcher {
|
|
id: root
|
|
|
|
readonly property list<Action> actions: [
|
|
Action {
|
|
name: qsTr("Shutdown")
|
|
desc: qsTr("Shutdown the system")
|
|
icon: "power_settings_new"
|
|
|
|
function onClicked(uiState: PersistentProperties): void {
|
|
Quickshell.execDetached(Config.session.shutdown);
|
|
}
|
|
},
|
|
Action {
|
|
name: qsTr("Reboot")
|
|
desc: qsTr("Reboot the system")
|
|
icon: "cached"
|
|
|
|
function onClicked(uiState: PersistentProperties): void {
|
|
Quickshell.execDetached(Config.session.reboot);
|
|
}
|
|
},
|
|
Action {
|
|
name: qsTr("Logout")
|
|
desc: qsTr("Log out of the session and go back to the startup screen")
|
|
icon: "logout"
|
|
|
|
function onClicked(uiState: PersistentProperties): void {
|
|
Quickshell.execDetached(Config.session.logout);
|
|
}
|
|
},
|
|
Action {
|
|
name: qsTr("Lock")
|
|
desc: qsTr("Activate the lock screen (hyprlock)")
|
|
icon: "lock"
|
|
|
|
function onClicked(uiState: PersistentProperties): void {
|
|
Quickshell.execDetached(Config.session.lock);
|
|
}
|
|
},
|
|
Action {
|
|
name: qsTr("Suspend")
|
|
desc: qsTr("Suspend the system")
|
|
icon: "bedtime"
|
|
|
|
function onClicked(uiState: PersistentProperties): void {
|
|
Quickshell.execDetached(Config.session.suspend);
|
|
}
|
|
},
|
|
Action {
|
|
name: qsTr("Hibernate")
|
|
desc: qsTr("Suspend, then hibernate the system")
|
|
icon: "downloading"
|
|
|
|
function onClicked(uiState: PersistentProperties): void {
|
|
Quickshell.execDetached(Config.session.hibernate);
|
|
}
|
|
}
|
|
]
|
|
|
|
function transformSearch(search: string): string {
|
|
return search.slice(Config.launcher.actionPrefix.length);
|
|
}
|
|
|
|
list: actions.filter(a => !a.disabled)
|
|
useFuzzy: true
|
|
|
|
component Action: QtObject {
|
|
required property string name
|
|
required property string desc
|
|
required property string icon
|
|
property bool disabled
|
|
|
|
function onClicked(uiState: PersistentProperties): void {
|
|
}
|
|
}
|
|
}
|