On Thu, 25 Aug 2011 at 21:52:26 +0300, Jason Brower wrote: > I like being able to close and open my laptop at any moment knowing > it will sleep and wake with no issue. However I haven't found the > command line equivalent for suspend and I was hoping some of you may > know. > In particular, how can I run the suspend command when the screen closes?
You can do that with acpid, adjusting things in /etc/acpi/actions and /etc/acpi/events For example: [mafra@Pilar:~]$ cat /etc/acpi/events/lid event=button/lid action=/etc/acpi/actions/sleep.sh %e [mafra@Pilar:~]$ cat /etc/acpi/actions/sleep.sh #!/bin/sh # if launched through a lid event and lid is open, do nothing echo "$1" | grep "button/lid" && grep -q open /proc/acpi/button/lid/LID0/state && exit 0 echo -n "mem" > /sys/power/state & su -c "xlock -mode matrix -display :0.0" mafra -- To unsubscribe, send mail to [email protected].
