1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

power: add fade to monitor off option

fixes #558
This commit is contained in:
bbedward
2026-01-03 15:00:12 -05:00
parent f3f720bb37
commit 6d76f0b476
7 changed files with 219 additions and 15 deletions

View File

@@ -23,15 +23,12 @@ Scope {
Quickshell.execDetached(["sh", "-c", SettingsData.customPowerActionLock]);
return;
}
shouldLock = true;
if (!processingExternalEvent && SettingsData.loginctlLockIntegration && DMSService.isConnected) {
DMSService.lockSession(response => {
if (response.error) {
console.warn("Lock: Failed to call loginctl.lock:", response.error);
shouldLock = true;
}
if (response.error)
console.warn("Lock: loginctl.lock failed:", response.error);
});
} else {
shouldLock = true;
}
}
@@ -81,6 +78,11 @@ Scope {
locked: shouldLock
onLockedChanged: {
if (locked)
dpmsReapplyTimer.start();
}
WlSessionLockSurface {
id: lockSurface
@@ -120,15 +122,12 @@ Scope {
target: "lock"
function lock() {
if (!root.processingExternalEvent && SettingsData.loginctlLockIntegration && DMSService.isConnected) {
root.shouldLock = true;
if (SettingsData.loginctlLockIntegration && DMSService.isConnected) {
DMSService.lockSession(response => {
if (response.error) {
console.warn("Lock: Failed to call loginctl.lock:", response.error);
root.shouldLock = true;
}
if (response.error)
console.warn("Lock: loginctl.lock failed:", response.error);
});
} else {
root.shouldLock = true;
}
}
@@ -140,4 +139,11 @@ Scope {
return sessionLock.locked;
}
}
Timer {
id: dpmsReapplyTimer
interval: 100
repeat: false
onTriggered: IdleService.reapplyDpmsIfNeeded()
}
}