Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-08-07 11:36:00

Jackie
Member
Registered: 2024-08-07
Posts: 4

Howto prevent anything but power button waking up system from suspend?

Hello,

I recently installed XUbuntu using XFCE on my laptop, and I have really struggled a lot to make suspend mode reliably not doing anything to wake up my system except for a short press on the power button, i.e. no mouse movement, no keyboard presses, nothing should allow the system to wake up.

1.) I have (nearly) handled the Keyboard/mouse issue by writing a short script in /etc/init.d/usbwakeup that is launched automatically at startup. Before the script runs, it looks like this:

grep . /sys/bus/usb/devices/*/product
/sys/bus/usb/devices/1-2/product:USB Composite Device
/sys/bus/usb/devices/1-4.1/product:2.4G Keyboard Mouse
/sys/bus/usb/devices/1-4/product:USB2.0 Hub
/sys/bus/usb/devices/usb1/product:xHCI Host Controller
/sys/bus/usb/devices/usb2/product:xHCI Host Controller
grep . /sys/bus/usb/devices/*/power/wakeup
/sys/bus/usb/devices/1-2/power/wakeup:enabled
/sys/bus/usb/devices/1-4.1/power/wakeup:enabled
/sys/bus/usb/devices/1-4/power/wakeup:disabled
/sys/bus/usb/devices/usb1/power/wakeup:disabled
/sys/bus/usb/devices/usb2/power/wakeup:disabled

After I run my script:

echo disabled > /sys/bus/usb/devices/1-2/power/wakeup
echo disabled > /sys/bus/usb/devices/1-4.1/power/wakeup

Everything looks like this:

grep . /sys/bus/usb/devices/*/power/wakeup
/sys/bus/usb/devices/1-2/power/wakeup:disabled
/sys/bus/usb/devices/1-4.1/power/wakeup:disabled
/sys/bus/usb/devices/1-4/power/wakeup:disabled
/sys/bus/usb/devices/usb1/power/wakeup:disabled
/sys/bus/usb/devices/usb2/power/wakeup:disabled

This works perfectly fine after a restart, but after some repeated testing with suspend-actions, the settings get reverted to enabled for the two USB dewvices 1-2 and 1-4.1, and I have no clue why this happens. Does anybody have an idea?

2.) Even more annoyoing, I managed to handle that the laptop lid is ignored when closing, but as soon as I open the lid, my system wakes up. What might I try to prevent the lid when opened from switching on the computer?

I already tried the following:
In logind.conf, I added the following lines:

HandleHibernateKeyLongPress=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore

And in UPower.conf:

IgnoreLid=true

Nothing of that helped. Closing the lid is actually ignored, but opening activates the system instantly. Any ideas? Thank you for all hints you may have.

Offline

#2 2024-08-26 14:42:43

uibits
Member
Registered: 2022-07-02
Posts: 39

Re: Howto prevent anything but power button waking up system from suspend?

Last I checked this was an issue on my Manjaro Xfce also. I agree that mouse moving should not wake it from sleep.

Here's hoping you find a solution.

Offline

#3 2024-08-27 00:56:18

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,481

Re: Howto prevent anything but power button waking up system from suspend?

Jackie wrote:

This works perfectly fine after a restart, but after some repeated testing with suspend-actions, the settings get reverted to enabled for the two USB dewvices 1-2 and 1-4.1, and I have no clue why this happens. Does anybody have an idea?

It sounds like maybe on resume the device gets re-recognized and treated like new - resetting the wakeup settings. Look at creating udev rules to disable wakeups on device recognition.

2.) Even more annoyoing, I managed to handle that the laptop lid is ignored when closing, but as soon as I open the lid, my system wakes up. What might I try to prevent the lid when opened from switching on the computer?

I already tried the following:
In logind.conf, I added the following lines:

HandleHibernateKeyLongPress=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore

And in UPower.conf:

IgnoreLid=true

Nothing of that helped. Closing the lid is actually ignored, but opening activates the system instantly. Any ideas? Thank you for all hints you may have.

Look at bypassing power management handling to logind, then those settings would take priority.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.013 seconds, 7 queries executed - Memory usage: 534.9 KiB (Peak: 535.74 KiB) ]