RSS

How to solve the ‘suspend does not work when laptop lid is closed’ problem in Ubuntu 12.10

26 Feb

I have recently upgraded my ThinkPad T500’s operating system to Ubuntu 12.10 and everything went very smooth except an annoying issue: the suspend functionality was not activated when I closed the laptop lid. Running pm-suspend from the command line, clicking on the Suspend from the GUI, or using the Fn+F4 key combination was working and my laptop was going into the sleep mode but somehow closing the lid was not achieving the same effect.

A quick Google search turned this bug report: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/863834 and a simple work around: https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/863834/comments/30

So I have decided to implement a similar workaround, but instead of using pm-suspend, I preferred to use dbus-send to invoke the sleep mode (see http://ubuntuforums.org/showpost.php?p=11331634&postcount=6 for more details):


#!/bin/bash
grep -q closed /proc/acpi/button/lid/*/state
if [ $? = 0 ]
then
dbus-send –system –print-reply –dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
fi

view raw

lid.sh.post

hosted with ❤ by GitHub

 
Leave a comment

Posted by on February 26, 2013 in Linux

 

Tags: , , ,

Leave a comment