jakeday / linux-surface

Linux Kernel for Surface Devices
2.6k stars 243 forks source link

Suspend on Ubuntu 18.04 #594

Open fiszuu opened 4 years ago

fiszuu commented 4 years ago

Hi,

I've recently installed Ubuntu on the Surface Laptop 2, followed the guide for the kernel and... I agreed to swap suspend and hibernate.

By editing systemd-logind.service I was experimenting with the closed lid action moving between suspend and hibernate options but found no difference. Closing lid always gets Ubuntu powered off.

Is there a way to get it working? Either suspend or hibernate.

I'd appreciate any advice or suggestons. Thanks

tmarkov commented 4 years ago

Well, the replacement on the script makes it so when you set something to 'suspend', it acts as if it was set to 'hibernate' instead - thus your attempts to change the settings don't matter (IMHO, that's why this a bad way to replace suspend with hibernate - much better to simply use the settings).

So if you want to use suspend, first you need to undo the replacement with sudo rm /etc/systemd/system/suspend.target /etc/systemd/system/systemd-suspend.service.

Once you do that, suspend should work out of the box. Hibernate is more complex to set up, but it's not surface-specific problem, and there are enough guides online about hibernate on Ubuntu.

fiszuu commented 4 years ago

Thank you. Worked like a charm. Much appreciated :+1: