init: working version
This commit is contained in:
commit
7d8d7dacae
109 changed files with 15066 additions and 0 deletions
86
modules/launcher/services/Actions.qml
Normal file
86
modules/launcher/services/Actions.qml
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
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 {
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue