Laptop sleep function only works properly with Slacko 5.3.3

Booting, installing, newbie
Post Reply
Message
Author
liro

#16 Post by liro »

Thanks ozsouth :) .

ssreddy
Posts: 41
Joined: Wed 12 Jun 2013, 16:39
Location: Hyderabad, India

Does this solution work for Desktop also?

#17 Post by ssreddy »

Does this solution work for Desktop also?

Mr.Puppy
Posts: 14
Joined: Mon 05 Aug 2013, 15:52

#18 Post by Mr.Puppy »

Do Suspbase and Susplid also work on other Linux distros like Antix?
ozsouth wrote:Unzip the attached to /usr/bin, ensure executable, then make a desktop icon.
Clicking the icon should suspend after 1 sec, requiring either a lid close then open, or just a power button push, to resume.
How do I add a desktop icon on the Puppy Precise Desktop?

I have installed the Susplid0 scriptfile to the /root/Starup directory. I have put the SuspBase file to the /usr/bin directory. As soon as my Puppy Precise 5.7.1 desktop has started, it immediately fals into the suspend-to-memory state. I press the power button to wake-up and it falls back again into the suspend state.

Listing SuspLid0 file:

Code: Select all

#!/bin/sh
# event handler to automatically suspend-to-ram when laptop lid is closed.

while true #Endless loop.
do
if grep -q open /proc/acpi/button/lid/LID0/state
then
sleep 12 # minimise resource usage
else
echo mem > /sys/power/state # send the suspend signal
sleep 1
fi
done
I dis ls /proc/acpi/button/lid and I saw the director LID instead of LID0. So I have to change the "if grep -q open /proc/acpi/button/lid/LID0/state" to "if grep -q open /proc/acpi/button/lid/LID/state"

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#19 Post by Karl Godt »

Sorry, but searching for acpi should bring a bunch of information .

The /usr/sbin/acpid is needed to launch scripts in /etc/acpi .

Unfortunately the values that are returned by the kernel for any buttons pressed might differ each patchlevel .

So files in /etc/acpi that get passed other values, than written in these , would simply ignore them .
I dis ls /proc/acpi/button/lid and I saw the director LID instead of LID0. So I have to change the "if grep -q open /proc/acpi/button/lid/LID0/state" to "if grep -q open /proc/acpi/button/lid/LID/state"
YES
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

Post Reply