You are not logged in.
Pages: 1
Ever since I installed linux I always had trouble getting the computer to suspend (also happened with ubuntu and debian), but now I have finally found a way to get my computer to suspend properly
i have to run the command:
sudo s2ram --force --acpi_sleep 2
Anyway, does anyone know of a way I can do this without having to add all the extra detail, or even just integrate it to the gui, also what does acpi_sleep actually mean?
Last edited by mofro (2011-10-08 18:10:47)
Offline
1. You can use an alias. Add the following to your ~/.bashrc and run suspend when you want to suspend.
alias suspend="sudo s2ram --force --acpi_sleep 2"
2. Install acpi (if you don't have it already) and edit /etc/acpi/handler.sh.
To get the sleep/suspend button working, change line 23 from
SLPB) echo -n mem >/sys/power/state ;;
to
SLPB) s2ram --force --acpi_sleep 2 ;;
To have your computer suspend when you close the lid and are on battery power, add the following under 'button/lid)'
if [ -n "$(cat /proc/acpi/ac_adapter/AC/state|grep off-line)" -a -n "$(cat /proc/acpi/button/lid/LID/state|grep closed)" ]; then
pm-suspend
fi
Steven [ web : git ]
GPG: 327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com
Offline
To add to Stebalien's option 1 you can grant your user permission to run that command without needing a password by adding the following to your sudoers file (with visudo)
user ALL=NOPASSWD:/usr/sbin/s2ram
Replace user with your username
Last edited by SS4 (2011-10-08 20:32:09)
Rauchen verboten
Offline
thanks guys, I used option 1 and it worked, for option 2, do I replace what's underneath 'button/lid' or do I just paste it underneath whats already there?
Offline
thanks guys, I used option 1 and it worked, for option 2, do I replace what's underneath 'button/lid' or do I just paste it underneath whats already there?
Post your handler.sh.
Steven [ web : git ]
GPG: 327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com
Offline
Pages: 1