After waking up the system, the lock screen appears, but doesn't allow putting the machine back to sleep. It rather has the option to shut down, which is a lot more dangerous since it's destructive. A suspend button would be useful here, perhaps more prominent than the shutdown button.
I think related to this, to me it doesn't show *any* option, but if i call the logout screen from kickoff, all correct screens are correctly loaded and work.
so seems that in many cases, the "canSuspend" "canReboot" etc variables in the lock screen qml (those that govern the visibility of the buttons to switch mode) are initialized with wrong values
To me, suspend is missing also when locking from Kickoff.
to me the problem is that is not consistent what options are shown, and it looks like an implementation detail creeping in the ui.
I think there should be some actions always shown, no matter what whas selected on kickoff, or if the dialog is shown in ksmserver or in the lock screen:
* switch user (probably atm not possible to show it in ksmserver? but should be made possible maybe in future releases)
hiding them if and only if the action is really not possible (due to insufficient permissions, not using a login manager or whatever)
we don't have switch user, but we have switch session.
I only implemented shutdown because for some reason ksmserver provides a shutdown feature, we can use powerdevil for sleep/hibernate/anything. Also for shutdown too.
Same issue here (Kubuntu 14.04).
1 - Have the lockscreen monitor power state (does DBUS warn of suspend entry/exit?)
2 - On exit suspend the lockscreen should enable 2 suspend options:
2a - Suspend button;
2b - Autosuspend timer (maybe with interval and enable/disable options in the control panel).
1 - Having the suspend option always enabled would defeat the screen lock. If the user locks his computer "on" then he probably wants it to stay that way.
2 - Enabling the suspen optionson suspend-exit means that theseoptions wouldonly bemade available ifthe computer was already suspended anyway, probably by user request. Allowing manual/automatic return to suspend would only be enforcing a previous choice by the user.
We removed the shutdown option and the like due to security reasons, so it doesn't make sense to add a suspend option, I suppose?
suspend is less dangerous than shutdown (and in opposite to shutdown can work). But exposes some problems: it allows a not logged in user to suspend the system, to suspend other running sessions. We cannot properly determine whether a not logged in user should be allowed to suspend the system. Checking KIOSK for the allowed action doesn't help us as it's for the logged in user.
A possible solution could be introducing a dedicated KIOSK action for suspending from lock screen. This would give the possibility to configure it to be secure for environments where it matters, but gives users the expected comfort.
Let the user decide.
Add three option like "allow suspend/shutdown/hibernate from lock screen" to the configuration dialog.
Just set defaults to disabled, so that security is not compromised for the careless user.
adding options is not the correct approach, this is not KDE 3.
This is a problem on laptops where closing the lid suspends and opening it wakes the laptop up. Closing the lid again does nothing, draining the battery. Maybe there is a possibility to detect if the machine was just woken up, allowing to suspend it again in that case only?
Naive approach: suspend sets a flag which enables the suspend button on lockscreen/suspend on closing the lid. This flag is reset once the user has logged in.
It's still possible to shutdown the system physically unless it's locked somewhere away from the display and HID devices or it's a remote session. Never seen both IRL, but it's possible, yes (but why leave remote session on and locked?). More, on most systems it's even still possible to both put the machine to sleep or shutdown it by switching to a [locked] TTY console unless these ACPI events are disabled (not the default in most cases, isn't it?). So it looks illogical to me that I can put my laptop to sleep by closing the lid but not by the keyboard shortcut (are there any laptops without a sleep button on the keyboard?).
For the record: I'm currently working on a solution which would allow to bring suspend back in the next release. I hope I found a way to make it secure.
(In reply to Martin Gräßlin from comment #12)
> For the record: I'm currently working on a solution which would allow to
> bring suspend back in the next release. I hope I found a way to make it
That would be great!
In KDE 4 i used to have widgets on my lockscreen, allowing me to suspend and hibernate. But in KDE 5 / Plasma 5 this isn't possible anymore.
I don't like to configure my notebook to go to standby if the display is closed. Because I like to put the notebook under my arm and go somewhere else, while the notebook is for example compiling something.
But sometimes I lock my notebook when leaving the office-room without it. And when I come back, I maybe just want to suspend it, because I'm going home with it.
And it's ridiculous, that I have to enter my password just to put the notebook into standby!
In a very general sense of security (NOT regarding the API infrastructure in KDE): Everyone in the room can just take the battery and ac cable out of my notebook to hardly shut it down. And suspend/hibernate are even less worse than a cold shutdown. So there's really no security in protecting theses actions with the users password.
Hibernating may even help if you're not in place and someone else needs to unplug/replug the power cable of your desktop pc. So he can power it down (hibernate) before he unplugs the cable.
Maybe in some scenarios, the ac cable / battery may be not accessible for a user and you want to keep others from suspending/hibernating the machine. So it's maybe wise to make this options configurable.
+1 to this in Arch KDE Plasma 5.8.
I'm using a Surface Pro 3 without a keyboard (sometimes). I want to be able to suspend and resume without logging in first. This is the default "sane" behavior in Windows. Power button or shutdown/suspend icons on screen always suspends regardless of lock screen state.
This shall be the default mode in laptops which shall be disabled by an option if more security is required.
Hope there are more users who try to use KDE on laptops!
The screen locker should be able to read the user Preference set in System Settings > Power Management > Energy Saving > "When laptop lid closed". For me on Plasma 5.11.4 it does, so I can suspend my laptop by closing the screen from kscreenlocker. But if the preference there is "Do nothing", or there is no lid because we're not a laptop, then I think adding a suspend button makes sense.
Seems odd to me that I can Switch User -> Shutdown/Suspend/Etc., but not do it directly from the screen locker. Can that be the default behavior? If allowed from the login screen, and switch user is allowed, then also allowed from the lock screen?
Also, if suspend/shutdown/etc., are allowed, would be nice if kscreenlocker5 responded to the relevant ACPI keys as well.
I am also in favour of having a button on the lockscreen to suspend.
Suspending by closing the lid is not enough. For example I configured the action of the laptop lid to do nothing, because I want to close it without suspending when my laptop is docked and connected to a monitor. In this case the lock screen would be shown in the second monitor, and opening and closing the lid would not suspend the laptop.
Moreover I have configured the power button to lock the screen, given that I do it often.
So my only option is to type the password to unlock and suspend, which is very annoying.
The more I think about it, the more I find myself agreeing that we should *at least* have the suspend option available. That's a non-destructive action for all use cases, and will make quite a few people happy given the use cases we've had presented so far.
Other familiar platforms (macOS, Windows, GNOME) also go so far as to allow you to shut down and reboot from the lock screen, even in a multi-user environment. They first display a scary warning declaring "This action may cause you or other logged-in users to lose work. Are you sure you want to proceed?"
We might consider doing something similar, if we warn the user about the potential consequences and only allow it for admin accounts when other users are logged in.
(In reply to Nate Graham from comment #18)
> The more I think about it, the more I find myself agreeing that we should
> *at least* have the suspend option available. That's a non-destructive
> action for all use cases, and will make quite a few people happy given the
> use cases we've had presented so far.
That is not true. A long running job might get cancelled due to suspend. My example for this is a long calculation in a science department. If we allow suspend a competing researcher might be able to destroy the work of a researcher. If we offer this it must be configurable.
> Other familiar platforms (macOS, Windows, GNOME) also go so far as to allow
> you to shut down and reboot from the lock screen, even in a multi-user
> environment. They first display a scary warning declaring "This action may
> cause you or other logged-in users to lose work. Are you sure you want to
> We might consider doing something similar, if we warn the user about the
> potential consequences and only allow it for admin accounts when other users
> are logged in.
We cannot. If an application asks to save a document the shutdown is stuck. The screen is locked and it is not possible to interact with the application requiring interaction. That's how session shutdown is guaranteed to work on Linux.
> That is not true. A long running job might get cancelled due to suspend. My
> example for this is a long calculation in a science department. If we allow
> suspend a competing researcher might be able to destroy the work of a
> researcher. If we offer this it must be configurable.
If we make it configurale, I suggest that the default is to allow to suspend. I believe that the users that require this level of security are the minority, so they need to opt-in.
> We cannot. If an application asks to save a document the shutdown is stuck.
> The screen is locked and it is not possible to interact with the application
> requiring interaction. That's how session shutdown is guaranteed to work on
In Linux or in KDE? How does GNOME deal with this?
(In reply to Simone Gaiarin from comment #20)
> > We cannot. If an application asks to save a document the shutdown is stuck.
> > The screen is locked and it is not possible to interact with the application
> > requiring interaction. That's how session shutdown is guaranteed to work on
> > Linux.
> In Linux or in KDE? How does GNOME deal with this?
In X11 to be precise. See ftp://ftp.x.org/pub/X11R7.0/doc/PDF/xsmp.pdf - how and if GNOME deals with that is at least to me totally irrelevant. What matters to me is the standard we implemented.
Please add a suspend-to-ram and a suspend-to-disk (if enabled) button.
Both should be configurable (guess one option for both should be OK).
(In reply to Kai Uwe Broulik from comment #6)
> We removed the shutdown option and the like due to security reasons, so it
> doesn't make sense to add a suspend option, I suppose?
Any pointer to the discussion leading to the removal would be appreciated.
To me it looks like this:
- physical access beats any software = allow power off, suspend / hibernate
- remote session = require password for power off, suspend / hibernate
agreed with Holger
*** Bug 402318 has been marked as a duplicate of this bug. ***
Hello everyone, as a Manjaro KDE user, I find it quite annoying when I accidentally turn on my computer, and can’t suspend it within the lock screen. Gnome allows a suspend function, so I don’t see why KDE can’t as well. It gets even more annoying when I accidentally turn on my brother’s computer, because then I have to call him over to login, then suspend his system. Can we either provide an suspend to ram option on the lock screen, or honor the power button as a way to suspend the system while in the lock screen, or both? Gnome allows for either the power button, or the pause button in the top right to be used to suspend the computer while in the lock screen. Even macs allow this. If this is a concern for some who want their computers on all the time, we should provide a “disable suspend while in lock screen,” to keep those people happy.
In addition to Buttons I would suggest changing the auto-suspend timer on the lock screen to something short like a minute, or at least giving the user the option to set a different timer for when the system is locked. There is no point to showing the lock screen for an hour or so.
That would be a nice addition! Please add this functionality KDE devs!s! It would be much appreciated!
*** Bug 404876 has been marked as a duplicate of this bug. ***
+1 for this feature!
I suggest to have configurable settings "Show suspend button on lock screen" and "Show shut down / restart buttons on lock screen".
They could be separate due to different severity.
Default could be off, so the current behavior would not change by default.
There are plenty of cases, where this would be convenient:
- PC wakes up randomly.
- Accidentally work up my PC.
- Woke up PC without knowing PW.
- Left PC running to finish some processing and suspend it later.
- Left PC in office and returning to the office quickly just to pick up the laptop.
I do not agree to the security concerns:
1. Default behavior would not change --> I click the box, so I am aware of the risk.
2. I have my password mainly to prevent unauthorized access, not to prevent unauthorized shutdown.
3. Anyone with physical access to the machine does not need the shut down button. He can press the power button / pull the plug / remove the battery / steal it / throw it out of the window / you name it...
4. In the rare case where I really want to prevent shutdown via the button (remote KVM workstation? or whatever), I just do not click the box in the settings.
5. Shutting down / suspending other users' sessions would be prevented by the normal KDE means, just as if I click the power button while I and someone else are logged in.
6. Windows / Gnome / Mac has it without facing major security issues.
While I support do the idea of a setting to customize which buttons are shown on the lock screen, I think it would be a viable alternative to just put a 'suspend' or 'cancel' button there. Suspending the system when the escape key is pressed would also be an option (current behaviour is showing the password prompt, which I don't think is a good reaction to pressing escape).
I love the idea of a cancel button, in which you get to choose either display sleep, suspend, or hibernate. It would be minimalistic and easy.
*** Bug 412212 has been marked as a duplicate of this bug. ***
bug 392798 contains a workaround to allow power actions via LockScreenUi.qml .
*** Bug 420283 has been marked as a duplicate of this bug. ***
*** Bug 424088 has been marked as a duplicate of this bug. ***
*** Bug 425617 has been marked as a duplicate of this bug. ***
Any progress on this?
No, I started working on it but got stuck.
Any shot at getting something like this for plasma 5.22? It's the last feature I really wish existed in plasma.
*** Bug 440897 has been marked as a duplicate of this bug. ***
(In reply to Kai Uwe Broulik from comment #6)
> We removed the shutdown option and the like due to security reasons, so it
> doesn't make sense to add a suspend option, I suppose?
Why? How does that improve security? If I am literally next to the computer, then I can force a complete shutdown by holding down the power button. This does not make any sense...
That's an old argument that nobody still holds. This is going to happen eventually. At the minimum, it's a requirement for Plasma Mobile, and if we do it there, we might as well do it for Plasma Desktop too.
(In reply to Nate Graham from comment #44)
> That's an old argument that nobody still holds. This is going to happen
> eventually. At the minimum, it's a requirement for Plasma Mobile, and if we
> do it there, we might as well do it for Plasma Desktop too.
I am pretty confident that quite a lot of people still hold it, and again I ask: how does it improve security?
What is going to happen eventually? If you are talking about hiding the power options before logging in then again: you can turn off any device by holding down the power button (which might harm the hardware, it's an emergency poweroff), and hopefully, it will remain this way. You should be able to turn any device off when needed, and if you don't want your computer to do that, then you could at least hide the power settings from the GUI - but solving it by disabling it for everyone is the worst way possible.
I mean the requested feature of showing power actions on the lock screen is going to get implemented eventually.
(In reply to Krystof Jelinek from comment #45)
> I am pretty confident that quite a lot of people still hold it, and again I
> ask: how does it improve security?
As a father of a 3 year old child I can tell you that I am very happy that the lock screen does not provide any destructive actions! It means I can lock the screen and don't have to care what will happen to the system. Editing an important document and tiny hands want to write things: lock the screen. Even the suspend option would be rather destructive as it means downloads, etc. might get cancelled by tiny hands.
(In reply to Nate Graham from comment #46)
> I mean the requested feature of showing power actions on the lock screen is
> going to get implemented eventually.
Oh, sorry about that... there are some people that would probably want that removed as well, so that's the reasoning before my reaction and I apologize for it.
So for satisfy both sides we can make those buttons optional - any who need them will can enable them and use...
Part of this has been implemented: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1122
To make it sort of more child-proof and secure we can make it optional and maybe add a button on the lockscreen that disables all power options - including "switch user" - until the session has been unlocked.
Ultimately in 99% of situations once phsical access is there it's a futile effort though. For example my cat lately force-shutdown my locked laptop because it's a very nice place to sit...
+1 for optionally disabling these in the KScreenlocker KCM.
Also I think we need to go all the way and add power actions too. :)
Have the other 2 features been implemented (optional disable and Shutdown/Restart)?
If they haven't i'd love this to be the way it's done
In the screen lock settings:
[X] Enable power these power actions on lock screen
[X] Restart and Shutdown
[ ] Require password to restart or shutdown from the lock screen
So, in which release the "Enable power these power actions on lock screen" option is available? I can't find it on my KDE:
Operating System: Kubuntu 21.10
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
It was a suggestion, it is not implemented yet.
Hmm, but the merge request https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1122 is merged, and I don't see the "Sleep" button on 5.23.1 and later releases. Will it land in 5.24 branch only, in February? Can't understand how to quickly look this up in Git repo...
Yes, that's 5.24 only.
Can I please ask (again) for all these options (including hibernate and sleep) to be user configurable?
I do understand that ultimately one cannot prevent people from shutting down a computer if they have physical access to the machine there are some valid use cases where exposing these options are suboptimal, especially when touch screens are involved.
Having the option to hide the functionality decreases the risk for your children to shutdown or put your computer to sleep while important processes are running (they like to touch screens!). Also if you run something in a kiosk mode and need to lock the screen exposing such options is less desirable.
If there's an option to expose media playing, I don't see a problem to not display options for showing shutdown/sleep in the kcm - quite the opposite, I was surprised I didn't find them there.
I would also like to ask for this to be user configurable. Currently KDE is completely unusable on my family PC. My PC will lock while I'm out for the day, and no one else can use the PC without a forced power down. It's not even a security concern if it's optional. Some people need to be able to shut down, log out, and restart from the lock screen without logging in.