https://bugs.kde.org/show_bug.cgi?id=392798

Alex Lieflander <pub...@atlief.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pub...@atlief.com

--- Comment #26 from Alex Lieflander <pub...@atlief.com> ---
(In reply to Dm from comment #23)
> (kubuntu 22.04, plasma 5.24.7, KDE Frameworks 5.92.0, QT 5.15.3, X11)
> There is a little hack: even when screen is locked, keyboard shortcuts are
> still available. So you can go to settings -> shortcuts -> power -> suspend
> (or hibernate) -> assign a new shortcut -> push power button (agree reassign)
> Now suspend (or hibernate) works in every case (logged in or lockscreen)
Another workaround is to use the "tiny-power-button" Linux kernel module. This
module waits for power button presses (like the "button" module that most
desktop environments use), but instead of sending the event to user-space it
directly sends a shutdown signal to your init manager. This completely bypasses
KDE-Plasma and thus allows the power button to work while the screen is locked.

Note:
1. Your kernel must have been compiled with the tiny-power-button module
2. Your init manager must support shutdown signals
3. This module only waits for power button presses
4. If compiled as a module, tiny-power-button must be loaded on every boot
5. The button module must not be loaded before or after the tiny-power-button
module is loaded
6. If the button module was compiled directly into the kernel you may need to
do other modifications

The relevant Kconfig option for note 1 is CONFIG_ACPI_TINY_POWER_BUTTON=m or
CONFIG_ACPI_TINY_POWER_BUTTON=y. By default, the signal used in note 2 is
different than SIGTERM and friends, and causes a graceful shutdown. Most init
managers (like SystemD) support it, but you could theoretically use another
signal at the risk of data loss. Due to note 3, events like closing the lid
wouldn't work and thus this workaround may not be suitable for laptops. Note 4
can be achieved on most systems by adding "tiny-power-button" to /etc/modules.
Note 5 can be achieved on most systems by adding "blacklist button" to
/etc/modprobe.d/blacklist.conf. The problematic Kconfig option in note 6 would
be CONFIG_ACPI_BUTTON=y, however you might still be able to use this workaround
by adding additional boot arguments.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to