Open ivanmlerner opened 2 years ago
before-sleep
listen to (e)logind's Prepare for sleep event.
Check sudo busctl monitor
to see if the events get sent and at what time.
Generally speaking, I recommend not relying on logind for running hooks. If you want something to happen before suspending the machine, just do it where you initiate suspend but before going through with it.
Hibernation, hybrid-sleep and suspend-then-hibernate are not triggering the before-sleep command.