mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
idle: add lock before suspend to idle manager
This commit is contained in:
@@ -192,6 +192,14 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function suspend() {
|
function suspend() {
|
||||||
|
if (SettingsData.lockBeforeSuspend) {
|
||||||
|
DMSService.lockSession(response => {
|
||||||
|
if (response.error) {
|
||||||
|
console.warn("Lock: Failed to call loginctl.lock:", response.error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (SettingsData.customPowerActionSuspend.length === 0) {
|
if (SettingsData.customPowerActionSuspend.length === 0) {
|
||||||
Quickshell.execDetached([isElogind ? "loginctl" : "systemctl", "suspend"])
|
Quickshell.execDetached([isElogind ? "loginctl" : "systemctl", "suspend"])
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user