summaryrefslogtreecommitdiff
path: root/modules/launcher
diff options
context:
space:
mode:
authorTim Hämisch <tim@thaemisch.net>2025-06-12 14:59:55 +0200
committerTim Hämisch <tim@thaemisch.net>2025-06-12 14:59:55 +0200
commit22b356d260f77b2a4a05a39c8a4c0fd409d3f53d (patch)
tree718524d2f2b9bceb38f13c39897227262f8542a7 /modules/launcher
parentMerge pull request #46 from Amstel-DEV/Battery-Width (diff)
downloadcaelestia-shell-22b356d260f77b2a4a05a39c8a4c0fd409d3f53d.tar.gz
caelestia-shell-22b356d260f77b2a4a05a39c8a4c0fd409d3f53d.tar.bz2
caelestia-shell-22b356d260f77b2a4a05a39c8a4c0fd409d3f53d.zip
Add shutdown, reboot, and logout actions to launcher
Diffstat (limited to 'modules/launcher')
-rw-r--r--modules/launcher/Actions.qml48
1 files changed, 48 insertions, 0 deletions
diff --git a/modules/launcher/Actions.qml b/modules/launcher/Actions.qml
index 0cbc870..4d74e05 100644
--- a/modules/launcher/Actions.qml
+++ b/modules/launcher/Actions.qml
@@ -68,6 +68,36 @@ Singleton {
}
},
Action {
+ name: qsTr("Shutdown")
+ desc: qsTr("Shutdown the system")
+ icon: "power_settings_new"
+
+ function onClicked(list: AppList): void {
+ list.visibilities.launcher = false;
+ shutdown.running = true;
+ }
+ },
+ Action {
+ name: qsTr("Reboot")
+ desc: qsTr("Reboot the system")
+ icon: "cached"
+
+ function onClicked(list: AppList): void {
+ list.visibilities.launcher = false;
+ reboot.running = true;
+ }
+ },
+ Action {
+ name: qsTr("Logout")
+ desc: qsTr("Logout of the current session")
+ icon: "logout"
+
+ function onClicked(list: AppList): void {
+ list.visibilities.launcher = false;
+ logout.running = true;
+ }
+ },
+ Action {
name: qsTr("Lock")
desc: qsTr("Lock the current session")
icon: "lock"
@@ -108,6 +138,24 @@ Singleton {
}
Process {
+ id: shutdown
+
+ command: ["systemctl", "poweroff"]
+ }
+
+ Process {
+ id: reboot
+
+ command: ["systemctl", "reboot"]
+ }
+
+ Process {
+ id: logout
+
+ command: ["sh", "-c", "(uwsm stop | grep -q 'Compositor is not running' && loginctl terminate-user $USER) || uwsm stop"]
+ }
+
+ Process {
id: lock
command: ["loginctl", "lock-session"]