You are not logged in.
Hi,
I am currently using uswsusp on my laptop to suspend to both disk and RAM, which works flawlessly by using the
$ s2bothcommand.
Now, I would like to use acpid to execute that command and also lock my screen using my display manager which is xdm, whenever I close the lid of my laptop and resume once I open it again.
passing
acpi_listenand then closing and opening the lid gives me:
button/lid LID close
button/lid LID openNext I created the following file: /etc/acpi/events/lid_close
It contains:
event=button/lid LID close.*
action=/etc/acpi/actions/lid_close.sh "%e"The problem is, that I have no idea what the corresponding lid_close.sh script would need to look like in order to do what I want it to do.
I'm aware that I would need an additional event file for the opening of the lid and a corresponding script, but for now I would be happy with automating the suspension/lock process and resuming manually using the power button.
Hopefully you can help me with this.
Thanks in advance.
Last edited by Troglodyte (2012-04-05 14:39:02)
Offline
If you want to lock the screen, on the wiki there is a script https://wiki.archlinux.org/index.php/Pm … or_suspend that uses pm-utils to achieve it.
For the first question, i think in /etc/acpi/handler.sh there are lid open/close options too, so you can put s2both there, while closing.
Hope I understood well your problems, and hope i could help you!
Offline
For the first question, i think in /etc/acpi/handler.sh there are lid open/close options too, so you can put s2both there, while closing.
Thanks for the reply.
There is a a part in the handler.sh script which would be activated upon closing/opening the lid.
button/lid)
case "$3" in
close)
#echo "LID closed!">/dev/tty5
;;
open)
#echo "LID opened!">/dev/tty5
;;
esac
;;But as I understand it all it does is print "LID closed!".
How do I make it execute the
$ s2bothcommand?
Offline
Put it in a line under #echo LID closed, before ;; !
Hope this will help you!
Offline
Ok.
my /etc/acpi/events/anything file now looks like this:
# Pass all events to our one handler script
event=button/lid LID close.*
action=/etc/acpi/handler.sh %eMy /etc/acpi/handler.sh looks like this
button/lid)
case "$3" in
close)
#echo "LID closed!">/dev/tty5
s2both
;;
open)
#echo "LID opened!">/dev/tty5
;;
esac
;;and it works!
Didn't think it would be that easy. Thanks for pointing me in the right direction nierro!
Now I just need to figure out how to return to xdm instead of my WM upon resume.
Last edited by Troglodyte (2012-04-05 13:01:33)
Offline
Well, as i said, there is a script for pm-utils, but i think you can use it with acpi too (when the lid gets opened, make that script run!)
Glad to have helped you !
Offline
Well, as i said, there is a script for pm-utils, but i think you can use it with acpi too (when the lid gets opened, make that script run!)
Glad to have helped you !
I knew from the wiki that it's possible to use pm-utils with acpid, but I didn't want to use pm-utils becuase it doesn't support suspend to both.
It would be nice if the wiki contained an example for using acpid and uswsusp like I am now.
Offline
you mustn't use pm-utils, copy and paste that script in a file, make it executable, then put the path to that script in handler.sh after lid open.
Offline