SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I found that to turn off the lid, a simple command needs to be executed:
Code:
xset dpms force off
I would simply set the commend for an action attribute, but it turns the lid back on upon activity from either a keyboard or a mouse.
My objective is to have press a key combo (Fn+F7 on my ThinkPad T60), have the lid turn off, and don't turn back on unless the same key combo was pressed again.
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,697
Thanked: 6
My fault, I did not know the radeontool was for ATI video cards only. My notebook has an ATI M9000. But using the other tool like vbetool in a similiar way may work for you.
i'm on dell inspiron 1300 laptop. i have a similar problem - my lcd panel doesn't recover when i re-open the lid (after closing). after some experiment, i found out that i can actually turn it back on if i can execute 'xset dpms force on'.
so, i tried putting the code into acpi_handler.sh - but, somehow it doesn't work. i'm sure the events (lid open/close) occurred because i added an echo to file command to the events. here's my code:
Code:
lid)
test=$(cat /proc/acpi/button/lid/LID/state)
test="${test##* }"
if [ "$test" = "open" ] ; then
/usr/bin/xset dpms force on
echo "$test" >> /home/king/test-open.acpi
else
echo "$test" >> /home/king/test-close.acpi
fi
;;
so, i'm wondering why the code doesn't work? if i manually execute the code after opening the lid, it works. any ideas?
i'm on dell inspiron 1300 laptop. i have a similar problem - my lcd panel doesn't recover when i re-open the lid (after closing). after some experiment, i found out that i can actually turn it back on if i can execute 'xset dpms force on'.
To understand you in the right way, what shall happen if you close the lid? Only a black display or a kind of suspend?
I use this script to suspend my notebook to ram (4 seconds) and resume it by pressing any key (2 seconds):
Code:
#!/bin/sh
# discover video card's ID
ID=`/sbin/lspci | grep VGA | awk '{ print $1 }' | sed -e 's@0000:@@' -e 's@:@/@'`
# securely create a temporary file
TMP_FILE=`mktemp /tmp/video_state.XXXXXX`
trap 'rm -f $TMP_FILE' 0 1 15
# switch to virtual terminal 1 to avoid graphics
# corruption in X
chvt 1
/sbin/hwclock --systohc
# write all unwritten data (just in case)
sync
# dump current data from the video card to the
# temporary file
cat /proc/bus/pci/$ID > $TMP_FILE
# suspend-to-ram
echo -n mem > /sys/power/state
# suspend-to-disk
# echo -n disk > /sys/power/state
/sbin/hwclock --hctosys
# restore video card data from the temporary file
# on resume
cat $TMP_FILE > /proc/bus/pci/$ID
# switch back to virtual terminal 7 (running X)
chvt 7
# remove temporary file
rm -f $TMP_FILE
I linked the script to the lid and everything works perfect (both suspend-modes).
I use this script to suspend my notebook to ram (4 seconds) and resume it by pressing any key (2 seconds):
I linked the script to the lid and everything works perfect (both suspend-modes).
Fluxx.
Does the command 'echo -n mem > /sys/power/state' makes the system go into suspend mode? How do you set how & when to resume? (I assume 4 & 2 seconds is the delay?) Also, I assume you don't actually have to check for '/proc/acpi/button/lid/LID/state' when executing this script from acpi_handler?
Does the command 'echo -n mem > /sys/power/state' makes the system go into suspend mode? How do you set how & when to resume? (I assume 4 & 2 seconds is the delay?) Also, I assume you don't actually have to check for '/proc/acpi/button/lid/LID/state' when executing this script from acpi_handler?
Thanks again.
p/s: by the way, are you the same flux on slax?
I have in /etc/acpi/events a file lid with these lines:
And in /etc/acpi/actions a script lid.sh with the posted lines of my suspend script (actually I have activ the line for suspend-to-ram).
If I close the lid the notebook suspends to ram (the whole process lasts 4 seconds) and if I press any key after opening the lid it will resume (this process lasts 2 seconds).
For suspend-to-disk you must have a kernel which is able to do this (cat /sys/power/state must give a disk as output).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.