Add shutdown, reboot, and logout actions to launcher
This commit is contained in:
parent
bef79bde1f
commit
22b356d260
1 changed files with 48 additions and 0 deletions
|
|
@ -67,6 +67,36 @@ Singleton {
|
||||||
Colours.setMode("dark");
|
Colours.setMode("dark");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
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 {
|
Action {
|
||||||
name: qsTr("Lock")
|
name: qsTr("Lock")
|
||||||
desc: qsTr("Lock the current session")
|
desc: qsTr("Lock the current session")
|
||||||
|
|
@ -107,6 +137,24 @@ Singleton {
|
||||||
list.search.text = `${LauncherConfig.actionPrefix}${text} `;
|
list.search.text = `${LauncherConfig.actionPrefix}${text} `;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 {
|
Process {
|
||||||
id: lock
|
id: lock
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue