LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 02-12-2007, 08:46 AM   #1
alkos333
Member
 
Registered: Dec 2006
Posts: 271

Rep: Reputation: 31
Lid Off/On with ACPI


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.
 
Old 02-12-2007, 04:55 PM   #2
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
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

Rep: Reputation: 61
Check out this post I did. I use the radeontool command.
http://www.linuxquestions.org/questi...99#post1383299

Also use the advance search feature and search for keymap and username Brian1. I have several other post on subjects like that.

Brian

Last edited by Brian1; 02-12-2007 at 04:56 PM.
 
Old 02-13-2007, 08:29 PM   #3
alkos333
Member
 
Registered: Dec 2006
Posts: 271

Original Poster
Rep: Reputation: 31
I downloaded radeontool and compiled it, but when I run it I get:

Code:
Radeon hardware not found in lspci output.
I tried running it both as a root and a user, but no luck. I have lspci and here its output:

Code:
root@alkos333:/home/me/software/radeontool-1.5# lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/940GML Express Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
00:1c.2 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3 (rev 02)
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller IDE (rev 02)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
02:00.0 Ethernet controller: Intel Corporation 82573L Gigabit Ethernet Controller
03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)
15:00.0 CardBus bridge: Texas Instruments PCI1510 PC card Cardbus Controller
 
Old 02-14-2007, 03:50 PM   #4
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
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

Rep: Reputation: 61
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.

Brian
 
Old 05-26-2007, 11:20 PM   #5
lordwolf
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 42

Rep: Reputation: 15
hi..

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?

thanks.

-kaz-
 
Old 05-27-2007, 09:29 AM   #6
Fluxx
Member
 
Registered: Aug 2005
Location: Bavaria, Germany
Distribution: Slackware (Current)
Posts: 225

Rep: Reputation: 30
Quote:
Originally Posted by lordwolf
hi..

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?

Fluxx.
 
Old 05-27-2007, 05:38 PM   #7
lordwolf
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 42

Rep: Reputation: 15
Quote:
Originally Posted by Fluxx
To understand you in the right way, what shall happen if you close the lid? Only a black display or a kind of suspend?

Fluxx.
Only a black display.. I don't think I set it to suspend or anything.
 
Old 05-27-2007, 05:46 PM   #8
Fluxx
Member
 
Registered: Aug 2005
Location: Bavaria, Germany
Distribution: Slackware (Current)
Posts: 225

Rep: Reputation: 30
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).

Fluxx.
 
Old 05-27-2007, 07:32 PM   #9
lordwolf
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 42

Rep: Reputation: 15
Quote:
Originally Posted by Fluxx
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?

Thanks again.

p/s: by the way, are you the same flux on slax?
 
Old 05-28-2007, 02:56 AM   #10
Fluxx
Member
 
Registered: Aug 2005
Location: Bavaria, Germany
Distribution: Slackware (Current)
Posts: 225

Rep: Reputation: 30
Quote:
Originally Posted by lordwolf
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:

Code:
event=button[ /]lid.*
action=/etc/acpi/actions/lid.sh
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).

And yes, I am flux in Slax forum.

Fluxx.
 
Old 05-28-2007, 10:26 PM   #11
lordwolf
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 42

Rep: Reputation: 15
Thanks flux..

all is well..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ACPI lid close on Inspiron 6000 with ATI x300 vxd Linux - Laptop and Netbook 1 03-06-2006 03:04 PM
ACPI Lid Question brokenflea Slackware 1 12-31-2005 04:09 AM
slack 10.1 acpi lid blanking issue... o2_sparx Linux - Laptop and Netbook 9 07-01-2005 12:57 AM
Inspiron 8500 LID switch with ACPI RBJohns Linux - Laptop and Netbook 8 05-21-2005 10:17 AM
lid close generates no acpi event mannyzen76 Linux - Laptop and Netbook 0 02-21-2004 11:37 PM


All times are GMT -5. The time now is 09:44 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration