Laptop does not sleep when lid shuts

Bug #1062817 reported by Ben Fredrickson
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Linux Mint
Confirmed
Undecided
Unassigned
Nouveau Xorg driver
New
Undecided
Unassigned
cinnamon
New
Undecided
Unassigned

Bug Description

Linux Mint Cinamon 64-bit

I have an external monitor on a Thinkpadx201. I close the lid and the external goes dark, but the laptop does not sleep.

I fixed it by adding a call to pm-suspend in /etc/acpi/lid.sh:

#!/bin/bash
# TODO: Change the above to /bin/sh

test -f /usr/share/acpi-support/state-funcs || exit 0

. /usr/share/acpi-support/power-funcs
. /usr/share/acpi-support/policy-funcs
. /etc/default/acpi-support

[ -x /etc/acpi/local/lid.sh.pre ] && /etc/acpi/local/lid.sh.pre

if [ `CheckPolicy` = 0 ]; then exit; fi

grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
then
    for x in /tmp/.X11-unix/*; do
 displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
 getXuser;
 if [ x"$XAUTHORITY" != x"" ]; then
     export DISPLAY=":$displaynum"
     . /usr/share/acpi-support/screenblank
 fi
# I ADDDED CALL TO PM-SUSPEND
 /usr/sbin/pm-suspend
    done
else
    for x in /tmp/.X11-unix/*; do
 displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
 getXuser;
 if [ x"$XAUTHORITY" != x"" ]; then
     export DISPLAY=":$displaynum"
     grep -q off-line /proc/acpi/ac_adapter/*/state
     if [ $? = 1 ]
  then
  if pidof xscreensaver > /dev/null; then
      su $user -c "xscreensaver-command -unthrottle"
  fi
     fi
     if [ x$RADEON_LIGHT = xtrue ]; then
  [ -x /usr/sbin/radeontool ] && radeontool light on
     fi
     if [ `pidof xscreensaver` ]; then
  su $user -c "xscreensaver-command -deactivate"
     fi
     su $user -c "xset dpms force on"
 fi
    done
fi
[ -x /etc/acpi/local/lid.sh.post ] && /etc/acpi/local/lid.sh.post

Revision history for this message
Paddy Launch (paddylaunch-deactivatedaccount) wrote :

Does the problem still exist for the OP when the external monitor is disconnected?

If so, I have the same problem.

Hardware: Dell Vostro 3750.
OS: Linux Mint 17 64-bit Cinnamon

The laptop will suspend OK on command from the Shutdown dialog, but fails to suspend when the lid is closed (even though that is how the default behaviour is set). Instead of suspending when the lid is closed it appears I am simply logged out and returned to the display manager.

I have no /etc/acpi/lid.sh on my system so cannot test the above workaround.

Revision history for this message
Paddy Launch (paddylaunch-deactivatedaccount) wrote :

I have an NVIDIA Optimus graphics card... my problem was solved when I installed nvidia-prime. The laptop now suspends correctly when the lid is closed.

Changed in linuxmint:
status: New → Confirmed
Revision history for this message
Leonardo Osorio Pelisoli (lopelisoli) wrote :

This bug also happens on Linux Mint 18 (Sarah) Cinnamon Edition.

The laptop is a Dell XPS Studio 1340. I'm not using an external monitor like the OP, but the laptop does not suspend when closing the lid (even though power management is set to suspend).

If I use the NVIDIA binary driver the bug does not happen (the laptop will suspend when closing the lid, as expected). For this reason I added a reference to the Nouveau driver to this report.

I believe this might be a reference to the following bug in Cinnamon:
https://github.com/linuxmint/Cinnamon/issues/4689
Launchpad does not seem to link directly to github bugs, so I'm leaving the URL here in the comment section.

Revision history for this message
Leonardo Osorio Pelisoli (lopelisoli) wrote :

On second thought, forget the link to the bug in Cinnamon. The OP in that one is about unplugging the power cord while the lid is closed, whereas this one is about closing the lid. Sorry about that.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.