Which are the approach (simplest possible) that we can use to get notified for Power Status changes (for instance when computer goes to sleep, hibernate, etc.) in Linux based systems?
I will need this mainly for persisting some state before sleeping, and of course, restoring that state once the computer wakes up.