TLDR: How to suspend from KDE LockScreen?
I'm using KDE's default lockscreen which you can somewhat configure But I haven't found a way to suspend my PC from the lockscreen, so I had to enter my password and then suspend every time I needed it which is very inconvenient.
Currently I modified KDE plasma lockscreen files (LockScreenUi.qml in particular) to add Suspend button. But maybe the is a simpler way to do this?
Also yes, I have seen reddit post and a few posts on kde forums without any solutions.
My configuration:
uname -a
Linux neko 4.15.14-1-ARCH #1 SMP PREEMPT Wed Mar 28 17:34:29 UTC 2018 x86_64 GNU/Linux
kded5 --version
kded5 5.45.0
plasmashell --version
plasmashell 5.12.5
The patch itself, it basically adds Suspend button with default icon and uses PowerDevil KDE service to suspend (found this usage logout files)
USE AT YOUR OWN RISK:
--- /usr/share/plasma/look-and-feel/org.kde.breeze.desktop/contents/lockscreen/LockScreenUi.qml 2018-05-01 16:03:40.000000000 +0300
+++ backups/kde-plasma-lockscreen/LockScreenUi.qml 2018-05-05 19:56:59.764353585 +0300
@@ -31,6 +31,18 @@
colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
+ function performOperation(what) {
+ var service = dataEngine.serviceForSource("PowerDevil");
+ var operation = service.operationDescription(what);
+ service.startOperationCall(operation);
+ }
+
+ PlasmaCore.DataSource {
+ id: dataEngine
+ engine: "powermanagement"
+ connectedSources: ["PowerDevil"]
+ }
+
Connections {
target: authenticator
onFailed: {
@@ -174,6 +186,11 @@
onClicked: mainStack.push(switchSessionPage)
// the current session isn't listed in the model, hence a check for greater than zero, not one
visible: (sessionsModel.count > 0 || sessionsModel.canStartNewSession) && sessionsModel.canSwitchUser
+ },
+ ActionButton {
+ text: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Suspend")
+ iconSource: "system-suspend"
+ onClicked: performOperation("suspendToRam")
}
]
EDIT1:
There is already a report for the feature on KDE bugtracker (thanks Lekensteyn for the link)
kded5 5.48.0
andplasmashell 5.13.4
(Manjaro). Am I missing the place where I should look?kded5 5.49.0
andplasmashell 5.13.4
(Arch) and it works (I have Suspend button in lockscreen), perhaps the original file updated and the patch doesn't apply cleanly, but you can always add it manually.