LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 02-01-2013, 02:26 PM   #1
zylak007
LQ Newbie
 
Registered: Feb 2013
Posts: 1

Rep: Reputation: Disabled
Custom action on lid close


Hello,
I'm having an issue with my lid "button". Normally it would detect a little magnet in the top of my screen when it is closed - this part works great. Unfortunately it also triggers randomly when there is a slight press on the area where the "button" is located. I have set action "nothing" on lid close in system settings (it's quite better than suspend) still my screen goes blank. This way from time to time my screen starts to flicker - really annoying.

I decided that I'm not going to solve this in hardware - instead I'd like to set a custom action for lid close event. More specifically I'd like to turn the screen off when the lid is closed for more than a second. This should work, as false signals from lid button last just for fractions of a second. Setting action to true "do nothing" would satisfy me just as well.

I'm running Ubuntu 12.04.1 LTS 64 bit with kernel 3.2.0-37-generic on Acer Aspire 7741G. The problem is irrelevant to OS - the button also behaves badly in Windows and BIOS. It started more than 1.5 years ago, but it wouldn't happen as often as now.

I don't know if this is going to help but I can check the current state of lid by reading '/proc/acpi/button/lid/LID0/state' - it is either "state: open" or "state: closed". I'm sure there is a way to control the behavior on lid close. I've had a situation, when somehow ACPI control functions of Linux got screwed - the file listed above would output "state: unsupported" instead and it seemed that BIOS took over the work of turning the screen off (it started to flicker instantly, without any lag - just as it does in BIOS). After restarting computer it was back to normal again. This shows that OS does control action on lid close - I need to find a way to change it.

Last edited by zylak007; 02-01-2013 at 11:27 PM.
 
Old 02-02-2013, 01:32 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
go at it the old fashioned way: Stop acpid; restart at once with acpid -l; tail -f on syslog, and you'll notice the acpi events show in the log.

Find your lidbutton event. That will probably be an event in /etc/acpi/events, which will call a script in /etc/acpi. Hack that script to your taste.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
No suspend on lid close AllanP Linux - Laptop and Netbook 26 05-19-2012 12:38 PM
Do nothing on close lid hda7 Debian 2 01-03-2012 10:15 AM
[SOLVED] How can I close lid without sleep? tquang Linux - Laptop and Netbook 5 07-12-2011 02:42 AM
Lid Close = Sleep mangogreg Linux - Hardware 2 08-28-2008 03:17 PM
lid action with different kernels terran4000 Linux - Laptop and Netbook 1 05-18-2004 10:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 05:23 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration