SUMMARY There is an awesome setting in KDE to automatically switch between either `suspend` or `suspend-then-hibernate` based on whether the laptop is on AC power or in battery mode. This is configured in **System settings > Power Management > Energy Saving > On AC power/On Battery/On Low Battery > While asleep, hibernate after a period of inactivity**. For example, one could configure sleep to be `suspend` when AC power is on and `suspend-then-hibernate` when in battery mode. Although this setting works the first time when adapter is disconnected, i.e., battery mode setting gets enabled, but the AC power mode option is not picked up upon reconnecting the adapter. STEPS TO REPRODUCE 1. Keep the laptop running in AC power while making sure battery charge is more than the "low" percentage (usually >10%). 2. **Disable** "System settings > Power Management > Energy Saving > On AC power > While asleep, hibernate after a period of inactivity". 3. **Enable** "System settings > Power Management > Energy Saving > On Battery > While asleep, hibernate after a period of inactivity". 4. [Optional] Make sure lid close action in both profiles is set to sleep. 5. Apply to save the settings. 6. Put the laptop to sleep (or if step#4 is set, close lid to sleep). 7. Resume from sleep and verify journal logs that system indeed called `suspend.target`. 8. Disconnect AC adapter. 9. Put the laptop to sleep (or if step#4 is set, close lid to sleep). 10. Resume from sleep and verify journal logs that system indeed called `suspend-then-hibernate.target`. 11. Reconnect AC adapter. 12. Put the laptop to sleep (or if step#4 is set, close lid to sleep). 13. Resume from sleep and check in journal logs if `suspend` or `suspend-then-hibernate` was called. OBSERVED RESULT Step#13 shows that `suspend-then-hibernate` was called even after AC adapter was reconnected. EXPECTED RESULT When AC adapter is reconnected, step#13 should put the system to `suspend` instead of `suspend-then-hibernate` state. SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE neon 5.20 KDE Plasma Version: 5.20.3 KDE Frameworks Version: 5.76.0 Qt Version: 5.15.1 ADDITIONAL INFORMATION
I would like to further add that this works as expected ONLY when automatic suspend is enabled in all the energy profiles. In case I do not want the system to automatically suspend when in AC power (i.e. when System settings > Power Management > Energy Saving > On AC power > Suspend session is disabled), the problem remains.
Thank you for the bug report. Unfortunately we were not able to get to it yet. Can we ask you to please check if this is still an issue with either Plasma 5.27 (the current LTS version) or Plasma 6.0.4 (the latest released version)?
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!