Ubuntu – Laptop does not suspend when lid is closed


I'm a new Ubuntu 13.10 user. Closing the lid of my laptop does not result in the computer entering suspend mode, meaning each time I close my lid without manually suspending the computer the battery dies.

The proper settings are set in Power Management — suspend the laptop on lid close for both AC and DC, but these do not have an effect on actual behavior.

It looks like this is a common problem for many users as far back as Ubuntu 11 — the only solution I could find is the below. However, as a new linux user I'm not aware of how to actually execute the instructions. If someone could provide additional detail that would be tremendously helpful.

Thanks in advance.

/etc/acpi/events/lidbtn triggers /etc/acpi/lid.sh which triggers
 /etc/acpi/local/lid.sh.post at the end of the script.
 /etc/acpi/local/* allows you to add your own config (e.g. required for

 generate /etc/acpi/local/lid.sh.post
 make it executable and add:

 grep -q closed /proc/acpi/button/lid/*/state
 if [ $? = 0 ]

 wmii will now go to suspend mode when closing the lid. It'll
 automatically wake up when opening the lid.

    load=$(cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0/capacity)
    if [ $load <= min_load ]; then

Best Answer

(Note that # before a command indicates that it should be run by the superuser, so replace the # with sudo.)

Open logind.conf as root: # vim /etc/systemd/logind.conf and remove the # before HandleLidSwitch=suspend. You can also change the option suspend to hibernate or poweroff

Fix from Launchpad Bug #863834, comment #30:

  1. Open a terminal: Ctrl + Alt + t
  2. # mkdir /etc/acpi/local
  3. # vim /etc/acpi/local/lid.sh.post
  4. Copy this short script:

     if grep -q closed /proc/acpi/button/lid/*/state

    ... and paste it into vim by typing: "+p

  5. Save by typing ZZ (in capitals)
  6. # chmod 755 /etc/acpi/local/lid.sh.post (so it works even when power management is handled under the logged-in user instead of root)