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

lock: bypass custom commands in ipc

This commit is contained in:
bbedward
2025-10-19 23:15:32 -04:00
parent daf3525e80
commit 0cb081a6d0
2 changed files with 16 additions and 7 deletions

View File

@@ -20,7 +20,7 @@ Scope {
function lock() {
if (SettingsData.customPowerActionLock && SettingsData.customPowerActionLock.length > 0) {
Quickshell.execDetached(SettingsData.customPowerActionLock.split(" "))
Quickshell.execDetached(["sh", "-c", SettingsData.customPowerActionLock])
return
}
if (!processingExternalEvent && SettingsData.loginctlLockIntegration && DMSService.isConnected) {
@@ -110,7 +110,16 @@ Scope {
target: "lock"
function lock() {
root.lock()
if (!root.processingExternalEvent && SettingsData.loginctlLockIntegration && DMSService.isConnected) {
DMSService.lockSession(response => {
if (response.error) {
console.warn("Lock: Failed to call loginctl.lock:", response.error)
root.shouldLock = true
}
})
} else {
root.shouldLock = true
}
}
function demo() {

View File

@@ -187,7 +187,7 @@ Singleton {
// Hyprland fallback
Hyprland.dispatch("exit")
} else {
Quickshell.execDetached(SettingsData.customPowerActionLogout.split(" "))
Quickshell.execDetached(["sh", "-c", SettingsData.customPowerActionLogout])
}
}
@@ -195,7 +195,7 @@ Singleton {
if (SettingsData.customPowerActionSuspend.length === 0) {
Quickshell.execDetached([isElogind ? "loginctl" : "systemctl", "suspend"])
} else {
Quickshell.execDetached(SettingsData.customPowerActionSuspend.split(" "))
Quickshell.execDetached(["sh", "-c", SettingsData.customPowerActionSuspend])
}
}
@@ -203,7 +203,7 @@ Singleton {
if (SettingsData.customPowerActionHibernate.length === 0) {
Quickshell.execDetached([isElogind ? "loginctl" : "systemctl", "hibernate"])
} else {
Quickshell.execDetached(SettingsData.customPowerActionHibernate.split(" "))
Quickshell.execDetached(["sh", "-c", SettingsData.customPowerActionHibernate])
}
}
@@ -211,7 +211,7 @@ Singleton {
if (SettingsData.customPowerActionReboot.length === 0) {
Quickshell.execDetached([isElogind ? "loginctl" : "systemctl", "reboot"])
} else {
Quickshell.execDetached(SettingsData.customPowerActionReboot.split(" "))
Quickshell.execDetached(["sh", "-c", SettingsData.customPowerActionReboot])
}
}
@@ -219,7 +219,7 @@ Singleton {
if (SettingsData.customPowerActionPowerOff.length === 0) {
Quickshell.execDetached([isElogind ? "loginctl" : "systemctl", "poweroff"])
} else {
Quickshell.execDetached(SettingsData.customPowerActionPowerOff.split(" "))
Quickshell.execDetached(["sh", "-c", SettingsData.customPowerActionPowerOff])
}
}