I want my laptop to suspend to ram when closing the lid when using Precise. Where do I find the script that controls this? I think it should be in /etc/acpi/events but I don't see it in Precise. Bionic works like I want it to, suspends to ram. Is it maybe an acpitools thing, that it needs to be installed? Currently the light just turns off when the lid is closed using Precise but I think that may be a BIOS setting.
I copied over the acpi files from Bionic but it doesn't work in Precise (the suspend script in itself works but not when closing the lid). Anyone got this going in Precise....
Nevermind, got it sorted. There was a pet install for Precise I found on the old forum. I attach it here for Precise users. Install and restart X.
Precise problem - Does not suspend when laptop lid is closed (SOLVED)
Moderator: Forum moderators
Precise problem - Does not suspend when laptop lid is closed (SOLVED)
- Attachments
-
- acpid-suspend-0.0.1.pet
- (5.91 KiB) Downloaded 57 times
- mikewalsh
- Moderator
- Posts: 6154
- Joined: Tue Dec 03, 2019 1:40 pm
- Location: King's Lynn, UK
- Has thanked: 792 times
- Been thanked: 1979 times
Re: Action when laptop lid is closed (SOLVED)
@amethyst :-
Me, I just use the very simple suspend script frenchiveruti found a few years ago on the old Forum. No idea where he dug it up from, though I've seen it mentioned in a few places since:-
suspend.sh
Code: Select all
#!/bin/sh
#
#'Suspend' script for Puppy
#
echo -n mem > /sys/power/state
Lives in /usr/sbin, and has long been incorporated into a modified LogOut GUI, as well as being key-bound via /etc/xdg/templates/_root_jwmrc. I switch the wireless mouse off, followed by hitting 'Pause/Break' on the keyboard (I thought that was the most appropriate key for it, since I don't use it for owt else), and *off.....* she pops.
(If I don't disable the mouse first, the slightest movement of the sensor 'wakes' Puppy up again. She's a very light sleeper, y'know..! )
Different routine with a desktop PC, obviously.
Mike.
Re: Action when laptop lid is closed (SOLVED)
mikewalsh wrote: ↑Thu Sep 02, 2021 4:20 pm@amethyst :-
Me, I just use the very simple suspend script frenchiveruti found a few years ago on the old Forum. No idea where he dug it up from, though I've seen it mentioned in a few places since:-
Code: Select all
#!/bin/sh # #'Suspend' script for Puppy # echo -n mem > /sys/power/state
Lives in /usr/sbin, and has long been incorporated into a modified LogOut GUI, as well as being key-bound via /etc/xdg/templates/_root_jwmrc. I switch the wireless mouse off, followed by hitting 'Pause/Break' on the keyboard (I thought that was the most appropriate key for it, since I don't use it for owt else), and *off.....* she pops.
(If I don't disable the mouse first, the slightest movement of the sensor 'wakes' Puppy up again. She's a very light sleeper, y'know..! )
Different routine with a desktop PC, obviously.
Mike.
Yes, that is what I used before as a keystroke however you need acpi for the lid thingy.
- 666philb
- Posts: 429
- Joined: Thu Jul 09, 2020 3:18 pm
- Location: wales uk
- Has thanked: 111 times
- Been thanked: 149 times
Re: Action when laptop lid is closed (SOLVED)
i think this worked for me on precise (a long long time ago)
- Attachments
-
- acpid-suspend-0.0.1.pet
- (5.91 KiB) Downloaded 48 times
fossapup64 viewtopic.php?f=40&t=88
Re: Action when laptop lid is closed (SOLVED)
My laptop would not stay suspended (it would immediately wake up.)
So I wrote a script to disable everything and anything permitted to wake it up.
Code: Select all
awk '/enabled/{print $1}' /proc/acpi/wakeup | while read a
do
echo "$a" > /proc/acpi/wakeup
done
Now, it suspends if I close the lid, and wakes up if I open the lid.
The mouse does not wake it.
Or I can execute /etc/acpi/actions/suspend.sh, which suspends without closing the lid.
Pressing any key wakes it.
The mouse does not wake it.
If you use a usb keyboard, probably the usb keyboard would not wake it.
Pressing the power button would probably wake it.
Also, I edited /etc/acpi/actions/suspend.sh slightly/
This would display an error message about the module built into the kernel, so I changed this:
rmmod ehci_hcd
to this:
rmmod ehci_hcd 2>/dev/null
And I wanted it to not suspend if a usb drive was plugged in, whether it was mounted or not, so I changed this:
# do not suspend if usb media mounted
to this:
probedisk2|grep -q '|usb' && exit
# do not suspend if usb media mounted
- mikewalsh
- Moderator
- Posts: 6154
- Joined: Tue Dec 03, 2019 1:40 pm
- Location: King's Lynn, UK
- Has thanked: 792 times
- Been thanked: 1979 times
Re: Action when laptop lid is closed (SOLVED)
@amethyst :-
Yes, that is what I used before as a keystroke however you need acpi for the lid thingy.
.....and for which a desktop PC has no use. No lid, obviously.
Ye anciente Dell lappie has a magnetic 'reed' switch embedded in the middle front edge of the lid. Obviously intended to trigger such a function (I know it used to work when she ran XP, many years ago. Never been able to get it to work under Puppy, though...)
She doesn't get very much use nowadays.
Mike.
- JASpup
- Posts: 1653
- Joined: Sun Oct 04, 2020 10:52 am
- Location: U.S.A.
- Has thanked: 70 times
- Been thanked: 89 times
Re: Action when laptop lid is closed (SOLVED)
Interestingly on my 32 laptop in Xenial the three events:
running the suspend.sh script
running
echo "mem" > /sys/power/state
closing my laptop lid
all do the blink for 1 second trick. Not sure what difference it makes if all are the same.
Does this need to be executed once each boot, or each time you suspend? I want to test it correctly.
Code: Select all
awk '/enabled/{print $1}' /proc/acpi/wakeup | while read a
do
echo "$a" > /proc/acpi/wakeup
done
Maybe Suspend has been too tricky to make an up-front Puppy function.
On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.
Re: Precise problem - Does not suspend when laptop lid is closed (SOLVED)
Does this need to be executed once each boot
Probably executing it once each boot would work.
Plugging in a new usb device, like a usb keyboard, might enable that device to wake up the machine, which might make suspend not work. Or unplugging then replugging in a usb keyboard or mouse.
So you could run the script from the suspend script, so that it executes everytime the suspend script runs.
It's a very light script. it almost does nothing. If it's run a second time, it really does do nothing.
- JASpup
- Posts: 1653
- Joined: Sun Oct 04, 2020 10:52 am
- Location: U.S.A.
- Has thanked: 70 times
- Been thanked: 89 times
Re: Precise problem - Does not suspend when laptop lid is closed (SOLVED)
williams2 wrote: ↑Tue Nov 09, 2021 11:39 pmProbably executing it once each boot would work.
Plugging in a new usb device, like a usb keyboard, might enable that device to wake up the machine, which might make suspend not work. Or unplugging then replugging in a usb keyboard or mouse.
So you could run the script from the suspend script, so that it executes everytime the suspend script runs.
It's a very light script. it almost does nothing. If it's run a second time, it really does do nothing.
Shinobar's script works like a champ on my XP laptop. It posed the instant dilemma of where to put it.
preliminary desktop placement
Tapping on the power button brings Xenialpup back to life. That is the same as XP. Walsh's idea of replacing Rebuild Menu in the logout gui could work (I see the usefulness of that button but always enter the command manually).
I think from reading other subject posts that we're probably suspending-to-ram [S3] vs. suspending-to-idle [S1] or standby [S2], but perhaps the sure check is in BIOS?
I will have to try williams2-suspend.sh back on the 7 netbook.
On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.
- JASpup
- Posts: 1653
- Joined: Sun Oct 04, 2020 10:52 am
- Location: U.S.A.
- Has thanked: 70 times
- Been thanked: 89 times
Re: Precise problem - Does not suspend when laptop lid is closed (SOLVED)
In Tahr JWM the williams2 pre-suspend code takes care of the 7 netbook.
The only noticed distinction is the netbook will wake with any key, and the XP laptop requires the power button.
On the Whiz-Neophyte Bridge
Linux Über Alles
Disclaimer: You may not be reading my words as posted.
-
- Posts: 1564
- Joined: Sun Jul 12, 2020 2:38 am
- Location: S.E. Australia
- Has thanked: 241 times
- Been thanked: 700 times
Re: Does not suspend when laptop lid is closed (SOLVED)
@williams2 - marvellous script! I have never been able to suspend under ubuntu clones (bionic64/fossa64) on a few of my laptops, but
I made your script executable & put it in /root/Startup as 'makesusp' so it will run on every startup, and suspend now works! Thankyou.