You are not logged in.
Pages: 1
I've installed Arch (64bit) on my Lenovo T61, and I'm trying to work out the quirks.
One of these quirks is getting the laptop to suspend when I shut the lid. Right now, I can call pm-suspend from the command line and it works like a charm. I can close the lid and it will "awaken" when I open said lid. However, I can't quite figure out how to get it to call that script when I close the lid. Anyone have any suggestions?
Offline
Offline
Do you know if that trick is supposed to work for my make/model of laptop? I ask because it doesn't for me.
Offline
It's supposed to work anytime you're using acpid (ie the acpid damon is running) ... .(and acpi recognizes the button/LID event, but I think that's true for almost all laptops, and certainly for T61).
Now if you want to do it this way (acpi way), then:
1) make sure acpid is installed
2) make sure acpid is running
3) just close and open lid -> have a look at /var/log/acpid.log, it should have lines relating to button/lid event at the end
4) have a look at, and edit, /etc/acpi/handler.sh (adding something like it's at that link to the appropriate place)
That should be sufficient.
Now if you're using KDE or GNOME, there might be some other (gui) way to configure these DE's to achieve this (kpowersave/gnome-power-manager) ... but I'm not sure (I don't use them).
Finally, there's probably a way to achieve this also with hal, but I'm no good in understanding hal's .fdi rules.
Offline
Yikes. I guess I had a brain cramp. I just copy/pasted from that link as per the instructions without thinking. The path was just off. It works if I use the following path instead....
/proc/acpi/button/lid/LID0/state
Thanks all.
Offline
I'll borrow this thread a little.
I am trying to power off my screen when I close the lid, my lm_lid.sh is:
#! /bin/sh
if [[ `cat /proc/acpi/button/lid/LID/state | tr -s " " | cut -d" " -f2` = "closed" ]]
then
echo closed > /dev/pts/1
/usr/bin/xset dpms force off
fi
test -f /usr/sbin/laptop_mode || exit 0
# lid button pressed/released event handler
/usr/sbin/laptop_mode auto
but it doesn't work, echo closed is run, xset not, but if I run xset from terminal it power offs screen normally, I even tried copying the whole if statement to other script, and it power off the screen again. Anybody has any idea what is going on? Ty.
EDIT: Found the solution http://lurker.gentoo-wiki.com/HOWTO_Aut … ur_monitor needed the xauth.
Last edited by b4d (2008-07-09 22:17:19)
Offline
Here is my lm_lid.sh
if grep -q open /proc/acpi/button/lid/LID/state
then
XAUTHORITY=/var/run/slim.auth /usr/bin/xset -display :0.0 dpms force on
/usr/sbin/laptop_mode auto
/usr/bin/logger dpms force on
/usr/bin/logger $XAUTHORITY
else
XAUTHORITY=/var/run/slim.auth /usr/bin/xset -display :0.0 dpms force off
/usr/in/logger dpms force off
/usr/bin/logger $XAUTHORITY
fi
Now, you will need to be sure to check for your XAUTHORITY
ps aux | grep X
Your output should show something like "-auth /path/to/file", change the XAUTHORITY variable in the above config and it should work.
Offline
For some reason I can't find a lm_lid.sh and the directory /etc/acpi/actions does not even exist. And yes, I do have acpi and acpid installed. Is it possible, that newer versions of acpi/acpid need another workaround for this?
now with 80% more sax-appeal!
"I hacked the Phrak, and all I got was this lousy signature"
Offline
AFAIK you will now have to take a look at /etc/acpid/handler.sh
Hessische Grüße
Offline
maybe it is /etc/acpi/handler.sh (see: acpi, not acpid!), it does exist, but acpid crashes at starting, so I'll reboot, to be able to test it.
Danke! Gruß zurück in's Hessenland! Bin gerade allerdings in Berlin, boah, die Berliner Schnute ist ja teilweise noch schlimmer, als das südhessische Gebabbel!
Update: It works! Thank you sooooo much!
Last edited by Flying Saxman (2008-07-28 18:39:24)
now with 80% more sax-appeal!
"I hacked the Phrak, and all I got was this lousy signature"
Offline
Nice to hear that
Offline
just one more question: I'd like to have my KDE4-Session locked after resuming, because it is a laptop and so it is thought for using it "on the road" and so on. But unfortunately I do have NO idea, how to solve this problem. Any suggestions/ideas?
now with 80% more sax-appeal!
"I hacked the Phrak, and all I got was this lousy signature"
Offline
There should be a configuration file for actions performed after/during restore (at least uswsusp has this functionality, so i expect pm-utils to do so either).
I will look for that file when i'm at a linux box again (using vista at work atm *ugly).
In that file you should place the command for locking the screen. For gnome for example:
gnome-screensaver-command -lock
for Xscreensaver:
xscreensaver-command --lock
I don't know which screensaver-daemon kde uses, but it shouldn't be too difficult to find it out.
*EDIT* found at google:
dcop kdesktop KScreensaverIface lock
you could try that on the konsole.
*EDIT2*This should help:
http://de.opensuse.org/Pm-utils#pm-util … Generation
Seems to me like you'd have to add an own hook that runs "dcop kdesktop KScreensaverIface lock" on resume, perhaps after waiting a few seconds (depends on kdesktops state, i.e. if it is already ready again).
Last edited by stylopath (2008-07-30 10:48:50)
Offline
Pages: 1