dev-resources.site
for different kinds of informations.
Ubuntu hibernate
Published at
10/6/2024
Categories
ubuntu
hibernate
linuxtips
productivity
Author
patfinder
Main Article
Author
9 person written this
patfinder
open
When working on Linux/Ubuntu, have you ever gotten tired of reopening tons of apps and workspaces again and again?
Itβs much cooler when you can open your machine with all your apps already running. Ubuntu has a lesser-known feature for this: hibernation
.
Letβs try this guide to enable hibernation on your Ubuntu system.
Only 3 steps as below:
Create and enable swap partition (swap file seem not working)
Create Polkit action.
nano /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
# NEW entry since Ubuntu 18:
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
# NEW entry since Ubuntu 18:
[Re-enable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
- Create clean up hook
sudo nano /etc/systemd/system/use-10_grub_common.service
[Unit]
Description=Execute the /etc/pm/sleep.d/10_grub_common script after hibernation.
After=hibernate.target
[Service]
Type=oneshot
ExecStart=/etc/pm/sleep.d/10_grub-common thaw
[Install]
WantedBy=hibernate.target
And enable this service: sudo systemctl enable use-10_grub_common
Enjoy using Ubuntu!
Featured ones: