Any way to activate amd_s2idle.py on the lid closed action?

Hello there !
I have often issue with the laptop being awake from sleep after a while when I close the lid. Every time I run manually the amd_s2idle.py script, everything goes well. So I’m wondering if the script can be activated on the closing lid event, and start waiting for a certain amount of time … maybe 7/8 hours to test against the night.
Is it something doable ?
Using fedora 39.

Thank’s

You should be able to run the script for 8 hours and then close the lid. I guess you tried that already?

Under KDE Plasma, you can run a script → Works for all power-states.

1 Like

I did not because I’ve read somewhere that there is a bug on the firmware when doing so (put to sleep then close the lid) and that we would only close the lid to put to sleep.
But I might have misread or misunderstood…

Thanks ! I’m gonna try tonight !
By the way, I hope you’re enjoying your new toy … right ? :wink:

Edit: oh, wait ! This is only for power state(battery/AC) but I’m looking for the lid close event. Is it available as an option on this page ?

There’s a workaround added in the kernel for that issue. It’s in Fedora kernels and stable, I don’t recall for sure if Ubuntu picked it up yet.

heh. yeah - playing with my new toy. My daughter has received her 13" - so having fun too.

And that option exists in all power-states: Power, Battery and low battery.