4

For a week I've now started using Ubuntu on my laptop as my main OS for work. Sometimes my laptop battery is finished, so it get's powered off. I'm not sure whether it does so in a somewhat graceful way, or that the power is simply cut.

When this happens, and I start it again after reconnecting the power it starts up afresh, without anything open. Is there a possibility to auto reopen all programs that I had open?

kramer65
  • 2,143

2 Answers2

5

save session

in gnome3 using dconf Editor and navigating to org.gnome.gnome-session should give you an option to auto-save sessionsenter image description here


Since that doesn't seem to work for a lot of users, you can also hibernate if your battery is low.


hibernate

There is a great How To from Ubuntu that should get you started, applicable to both Wayland and Gnome.

If that doesn't work there is this great answer for an alternative solution for Gnome.

Robert Riedl
  • 4,351
1

You don't mention your Ubuntu version or your Desktop Environment.

I'm using Ubuntu 16.04 LTS with Unity Desktop.

When the battery starts running low, warning messages (via pop-up bubbles) start appearing. This is designed to give you time to start saving your work and gracefully power down your system.

The other answer references Gnome and if you are on Ubuntu 17.10 you may be using Wayland which may not give you the same warning messages.

In either case this Ask Ubuntu Q&A How to change critically low battery value? should prove helpful. One answer in particular states:

Looks like Gnome moved the settings. Critically low battery is now handled by UPower. Instead of using gsettings, you should now edit the file /etc/UPower/UPower.conf

UsePercentageForPolicy=true
PercentageLow=10
PercentageCritical=3
PercentageAction=2
CriticalPowerAction=HybridSleep

I hope this helps!

  • Thanks for your answer. This is not about saving work though. This is about having 20 programs open, that I don't want to think of reopening myself. It's not about saving work, but about saving time and working more effectively. – kramer65 Feb 22 '18 at 05:30