Use CompositorService power commands in LockScreen
This commit is contained in:
parent
b8b660db08
commit
89d0551f3e
3 changed files with 6 additions and 22 deletions
|
|
@ -48,22 +48,6 @@ Loader {
|
||||||
property string password: ""
|
property string password: ""
|
||||||
property bool pamAvailable: typeof PamContext !== "undefined"
|
property bool pamAvailable: typeof PamContext !== "undefined"
|
||||||
|
|
||||||
// Process components for system commands
|
|
||||||
Process {
|
|
||||||
id: shutdownProcess
|
|
||||||
command: ["shutdown", "-h", "now"]
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: rebootProcess
|
|
||||||
command: ["reboot"]
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: logoutProcess
|
|
||||||
command: ["loginctl", "terminate-user", Quickshell.env("USER")]
|
|
||||||
}
|
|
||||||
|
|
||||||
function unlockAttempt() {
|
function unlockAttempt() {
|
||||||
Logger.log("LockScreen", "Unlock attempt started")
|
Logger.log("LockScreen", "Unlock attempt started")
|
||||||
|
|
||||||
|
|
@ -932,7 +916,7 @@ Loader {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
shutdownProcess.running = true
|
CompositorService.shutdown()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -986,7 +970,7 @@ Loader {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
rebootProcess.running = true
|
CompositorService.reboot()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1040,7 +1024,7 @@ Loader {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
logoutProcess.running = true
|
CompositorService.logout()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ Variants {
|
||||||
|
|
||||||
// Only show on screens that have notifications enabled
|
// Only show on screens that have notifications enabled
|
||||||
visible: modelData ? (Settings.data.notifications.monitors.includes(modelData.name)
|
visible: modelData ? (Settings.data.notifications.monitors.includes(modelData.name)
|
||||||
|| (Settings.data.notifications.monitors.length === 0)) : false
|
|| (Settings.data.notifications.monitors.length === 0)) : false
|
||||||
|
|
||||||
// Position based on bar location, like Notification popup does
|
// Position based on bar location, like Notification popup does
|
||||||
anchors {
|
anchors {
|
||||||
|
|
@ -57,7 +57,7 @@ Variants {
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// Only register toasts for screens that have notifications enabled
|
// Only register toasts for screens that have notifications enabled
|
||||||
if (modelData ? (Settings.data.notifications.monitors.includes(modelData.name)
|
if (modelData ? (Settings.data.notifications.monitors.includes(modelData.name)
|
||||||
|| (Settings.data.notifications.monitors.length === 0)) : false) {
|
|| (Settings.data.notifications.monitors.length === 0)) : false) {
|
||||||
// Register this toast with the service
|
// Register this toast with the service
|
||||||
ToastService.allToasts.push(toast)
|
ToastService.allToasts.push(toast)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,7 @@ Singleton {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allDismissed) {
|
if (allDismissed) {
|
||||||
isShowingToast = false
|
isShowingToast = false
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue