I have Lenovo notebook with Arch linux. When I run out of battery and my notebook dies, after starting it. It freshly boots new session. Is there a way to restore previous session and continue in it ?

PS: I use systemd, xserver and i3wm

Thank you for your help

  • 3
    Do you have your laptop set up to hibernate when it is almost out of battery? – terdon Feb 18 at 17:43
  • If you make answer with some elegant way to achieve it, I will accept your answer. – Jan Černý Feb 18 at 18:37

First setup hibernation on arch,

Then create a udev rule to hibernate on low battery percentage,

Haven't tested the udev rule myself but should work.

  • The real answer. That, or doing everything in a Virtual Machine and save the execution state. Since one can hibernate with a swap file, a swap partition is not needed. – X.LINK Feb 21 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.