1

I just installed ubuntu then I installed gnome then I instaled TLP(power manegment) now I want to hibernate the computer when lid is close. I followed this instructions:

Is it possible to make 16.04 hibernate on lid close? | Ask Ubuntu

and this instructions:

Ubuntu 16.04: Shutdown / Hibernate Your Laptop When Lid is Closed | UbuntuHandbook

and nothing work.

1 Answers1

2

I'd recommend working this issue in steps.

  1. First,to get hibernate tested and working on your laptop, please read the Ubuntu documentation regarding hibernation. Important: make sure your swap file is larger than your physical RAM, and that it's enabled.

  2. Once you know your laptop can hibernate properly, you can assign laptop actions to trigger hibernation. In your case, you'd like to hibernate on lid close. There's plenty of documentation out in the aether on this topic, but let's go to the source documentation on this: the systemd login configuration file manpage. Of particular interest is the section that describes the HandleLidSwitch option.According to the documentation, that option

    Can be one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", and "lock".

    You want hibernate (in my own case, I use hybrid-sleep). So, now it's a matter of editing the logind.conf file to accommodate this setting (you must be root to do this).

    In /etc/systemd you'll see a file called logind.conf. Open it for edit, and scroll down to a line that looks like this:

    #HandleLidSwitch=suspend

    The prepended # means that this line is currently disabled, so you need to remove it, and then set HandleLidSwitch to the correct option

    HandleLidSwitch=hibernate

    Save the logind.conf file and reboot.

richbl
  • 2,373