0

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

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

1 Answer 1

3

First setup hibernation on arch,
https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate#Hibernation

Then create a udev rule to hibernate on low battery percentage,
https://wiki.archlinux.org/index.php/laptop#Hibernate_on_low_battery_level

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

1
  • 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. Commented Feb 21, 2021 at 6:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.