Bug 482288 - [Feature Request] Add sleep button event switcher to energy settings
Summary: [Feature Request] Add sleep button event switcher to energy settings
Status: RESOLVED INTENTIONAL
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_powerdevil (other bugs)
Version First Reported In: 6.0.0
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-03 11:13 UTC by BOF
Modified: 2024-03-09 09:00 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
KDE energy settings (123.49 KB, image/png)
2024-03-03 11:17 UTC, BOF
Details
laptop keyboard sleep key (130.60 KB, image/jpeg)
2024-03-06 21:40 UTC, BOF
Details
windows energy settings (81.19 KB, image/png)
2024-03-09 09:00 UTC, BOF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BOF 2024-03-03 11:13:02 UTC
SUMMARY
My suggestion is to add an option to change the behaviour of what happens when the sleep button is pressed to the energy options.
I would have searched there first, because the events for closing the lid and pressing the power buttons are also collected there.

Currently the activity when the sleep mode button is pressed is controlled on the keyboard shortcuts. I would also expect this setting to be found in the energy options.
Since I'm using a laptop pressing the power button is pretty much the same as pressing a key on the keyboard so there also is not really a big difference (some OEMs even include the power button right next to a button inside the keyboard that is hardly every used like backspace or enter).

SOFTWARE/OS VERSIONS
Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.5.0-21-generic (64-bit)
Graphics Platform: Wayland
Comment 1 BOF 2024-03-03 11:17:11 UTC
Created attachment 166342 [details]
KDE energy settings

The option to control the sleep button behaviour would be added here
Comment 2 Nate Graham 2024-03-05 18:55:23 UTC
> when the sleep button is pressed
Do I take it to mean that you have a keyboard with an actual button on it that puts the system to sleep, maybe with like a moon icon or something? Is that correct?
Comment 3 BOF 2024-03-06 09:50:40 UTC
(In reply to Nate Graham from comment #2)
> > when the sleep button is pressed
> Do I take it to mean that you have a keyboard with an actual button on it
> that puts the system to sleep, maybe with like a moon icon or something? Is
> that correct?

Yes and no.
On my keyboard there is not a single dedicated physical button for the sleep mode, but rather the F12 key doubles as sleep button when the function key is held down.
Not sure if that is what you meant with 'a keyboard with an actual button on it'
Comment 4 Nate Graham 2024-03-06 17:33:32 UTC
Would you mind taking a photo of the key?
Comment 5 Natalie Clarius 2024-03-06 21:38:12 UTC
And in the shortcuts settings you have an entry like "Suspend" assigned to shortcut "Sleep" which, if disabled, makes your sleep button do nothing?
Comment 6 BOF 2024-03-06 21:40:03 UTC
Created attachment 166512 [details]
laptop keyboard sleep key

(In reply to Nate Graham from comment #4)
> Would you mind taking a photo of the key?

Sleep key on my laptops keyboard.
Standalone keyboard (for a regular desktop PC) sometimes also do have a button like it.
Comment 7 Natalie Clarius 2024-03-06 21:50:28 UTC
(In reply to Natalie Clarius from comment #5)
> And in the shortcuts settings you have an entry like "Suspend" assigned to
> shortcut "Sleep" which, if disabled, makes your sleep button do nothing?
Comment 8 BOF 2024-03-06 22:31:51 UTC
(In reply to Natalie Clarius from comment #7)
> (In reply to Natalie Clarius from comment #5)
> > And in the shortcuts settings you have an entry like "Suspend" assigned to
> > shortcut "Sleep" which, if disabled, makes your sleep button do nothing?

Exactly.
[translated german settings]:
Settings > keyboard > shortcuts (left column) > KDE energy management (center column) > Standby-Modus
Here you have a checkbox to disable the sleep mode and you are also able to add your own keyboard shortcut 

BTW: This is the default KDE settings app with nothing added to it. So everybody should have the exact same setting.
Comment 9 Natalie Clarius 2024-03-06 23:10:54 UTC
Thanks for the info. This could be kind of a lot of keys to add though (Hibernate, Power Down, Power Off, Suspend, in addition to screen and keyboard backlight toggles), so maybe linking to the shortcut settings page with the Power Management section setting selected could be an alternative.
Comment 10 Nate Graham 2024-03-08 22:10:34 UTC
The power button is rather special, hence its special handling. This "Sleep" key is just a normal key like any other, so I think the most natural thing for us to do is nothing, because you can re-bind the key yourself to do something else in System Settings > Keyboard > Shortcuts > Power Management. Just choose the action you want to do instead and assign that key to it. You'll be warned of a conflict with the existing keybinding, so let it re-assign it.
Comment 11 BOF 2024-03-09 08:59:06 UTC
I don't think so.
On my keyboard I can close the lid and I have a power as well as a sleep button. These three are very common buttons on laptops and all that would be missing is one extra line for the sleep button. (There is no use in an extra power button since once your machine is "ON" you can not turn it on again before turning it off. There also is one button for sleep (be it suspend or hibernate))

Don't get me wrong: I don't request all keyboard shortcuts to be controllable through the energy menu.

I don't think that a link within the settings to a different part looks very good. In an unknown system it always leaves me with a feeling of 'if you can control it, why not let me switch the button where I found it in the first place?'. This is something I always disliked about Windows: You have a settings app, but they send you around through different pages and different settings apps.
BTW: I'll included the energy settings from Windows as well.
Comment 12 BOF 2024-03-09 09:00:12 UTC
Created attachment 166781 [details]
windows energy settings