mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
Add ability to disable loginctl lock integration
This commit is contained in:
@@ -70,6 +70,7 @@ Singleton {
|
|||||||
property int batteryHibernateTimeout: 0 // Never
|
property int batteryHibernateTimeout: 0 // Never
|
||||||
|
|
||||||
property bool lockBeforeSuspend: false
|
property bool lockBeforeSuspend: false
|
||||||
|
property bool loginctlLockIntegration: true
|
||||||
property var recentColors: []
|
property var recentColors: []
|
||||||
property bool showThirdPartyPlugins: false
|
property bool showThirdPartyPlugins: false
|
||||||
|
|
||||||
@@ -152,6 +153,7 @@ Singleton {
|
|||||||
batterySuspendTimeout = settings.batterySuspendTimeout !== undefined ? settings.batterySuspendTimeout : 0
|
batterySuspendTimeout = settings.batterySuspendTimeout !== undefined ? settings.batterySuspendTimeout : 0
|
||||||
batteryHibernateTimeout = settings.batteryHibernateTimeout !== undefined ? settings.batteryHibernateTimeout : 0
|
batteryHibernateTimeout = settings.batteryHibernateTimeout !== undefined ? settings.batteryHibernateTimeout : 0
|
||||||
lockBeforeSuspend = settings.lockBeforeSuspend !== undefined ? settings.lockBeforeSuspend : false
|
lockBeforeSuspend = settings.lockBeforeSuspend !== undefined ? settings.lockBeforeSuspend : false
|
||||||
|
loginctlLockIntegration = settings.loginctlLockIntegration !== undefined ? settings.loginctlLockIntegration : true
|
||||||
recentColors = settings.recentColors !== undefined ? settings.recentColors : []
|
recentColors = settings.recentColors !== undefined ? settings.recentColors : []
|
||||||
showThirdPartyPlugins = settings.showThirdPartyPlugins !== undefined ? settings.showThirdPartyPlugins : false
|
showThirdPartyPlugins = settings.showThirdPartyPlugins !== undefined ? settings.showThirdPartyPlugins : false
|
||||||
|
|
||||||
@@ -215,6 +217,7 @@ Singleton {
|
|||||||
"batterySuspendTimeout": batterySuspendTimeout,
|
"batterySuspendTimeout": batterySuspendTimeout,
|
||||||
"batteryHibernateTimeout": batteryHibernateTimeout,
|
"batteryHibernateTimeout": batteryHibernateTimeout,
|
||||||
"lockBeforeSuspend": lockBeforeSuspend,
|
"lockBeforeSuspend": lockBeforeSuspend,
|
||||||
|
"loginctlLockIntegration": loginctlLockIntegration,
|
||||||
"recentColors": recentColors,
|
"recentColors": recentColors,
|
||||||
"showThirdPartyPlugins": showThirdPartyPlugins
|
"showThirdPartyPlugins": showThirdPartyPlugins
|
||||||
}, null, 2))
|
}, null, 2))
|
||||||
@@ -643,6 +646,11 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setLoginctlLockIntegration(enabled) {
|
||||||
|
loginctlLockIntegration = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
function setShowThirdPartyPlugins(enabled) {
|
function setShowThirdPartyPlugins(enabled) {
|
||||||
showThirdPartyPlugins = enabled
|
showThirdPartyPlugins = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
|
|||||||
@@ -219,11 +219,20 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DankToggle {
|
||||||
|
width: parent.width
|
||||||
|
text: I18n.tr("Enable loginctl lock integration")
|
||||||
|
description: "Bind lock screen to dbus signals from loginctl. Disable if using an external lock screen."
|
||||||
|
checked: SessionData.loginctlLockIntegration
|
||||||
|
onToggled: checked => SessionData.setLoginctlLockIntegration(checked)
|
||||||
|
}
|
||||||
|
|
||||||
DankToggle {
|
DankToggle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: I18n.tr("Lock before suspend")
|
text: I18n.tr("Lock before suspend")
|
||||||
description: "Automatically lock the screen when the system prepares to suspend"
|
description: "Automatically lock the screen when the system prepares to suspend"
|
||||||
checked: SessionData.lockBeforeSuspend
|
checked: SessionData.lockBeforeSuspend
|
||||||
|
visible: SessionData.loginctlLockIntegration
|
||||||
onToggled: checked => SessionData.setLockBeforeSuspend(checked)
|
onToggled: checked => SessionData.setLockBeforeSuspend(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,10 @@ Singleton {
|
|||||||
detectHibernateProcess.running = true
|
detectHibernateProcess.running = true
|
||||||
detectPrimeRunProcess.running = true
|
detectPrimeRunProcess.running = true
|
||||||
console.log("SessionService: Native inhibitor available:", nativeInhibitorAvailable)
|
console.log("SessionService: Native inhibitor available:", nativeInhibitorAvailable)
|
||||||
|
if (!SessionData.loginctlLockIntegration) {
|
||||||
|
console.log("SessionService: loginctl lock integration disabled by user")
|
||||||
|
return
|
||||||
|
}
|
||||||
if (socketPath && socketPath.length > 0) {
|
if (socketPath && socketPath.length > 0) {
|
||||||
checkDMSCapabilities()
|
checkDMSCapabilities()
|
||||||
} else {
|
} else {
|
||||||
@@ -291,10 +295,29 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SessionData
|
||||||
|
|
||||||
|
function onLoginctlLockIntegrationChanged() {
|
||||||
|
if (SessionData.loginctlLockIntegration) {
|
||||||
|
if (socketPath && socketPath.length > 0) {
|
||||||
|
checkDMSCapabilities()
|
||||||
|
} else {
|
||||||
|
initFallbackLoginctl()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
subscriptionSocket.connected = false
|
||||||
|
lockStateMonitorFallback.running = false
|
||||||
|
loginctlAvailable = false
|
||||||
|
stateInitialized = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DankSocket {
|
DankSocket {
|
||||||
id: subscriptionSocket
|
id: subscriptionSocket
|
||||||
path: root.socketPath
|
path: root.socketPath
|
||||||
connected: loginctlAvailable
|
connected: loginctlAvailable && SessionData.loginctlLockIntegration
|
||||||
|
|
||||||
onConnectionStateChanged: {
|
onConnectionStateChanged: {
|
||||||
root.subscriptionConnected = connected
|
root.subscriptionConnected = connected
|
||||||
@@ -342,6 +365,10 @@ Singleton {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!SessionData.loginctlLockIntegration) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (DMSService.capabilities.includes("loginctl")) {
|
if (DMSService.capabilities.includes("loginctl")) {
|
||||||
loginctlAvailable = true
|
loginctlAvailable = true
|
||||||
if (!stateInitialized) {
|
if (!stateInitialized) {
|
||||||
|
|||||||
Reference in New Issue
Block a user