LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-21-2009, 04:36 PM   #16
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022

Original Poster
Blog Entries: 19

Rep: Reputation: 146Reputation: 146

The best fix I've come up with so far is enabling laptop-mode and then enabling laptop-mode when on AC power in th conf file you listed above. It seems to work; but it stills dims the screen to black when the AC is unplugged. Oh well, much better than suspending it.
 
Old 12-21-2009, 04:42 PM   #17
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022

Original Poster
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
If anybody is versed in C I think it's possible to stop the dimming of screen to black editing /usr/share/acpi-support/power-funcs:
Code:
# a micro library of helper functions for the power scripts

umask 022;

PATH="$PATH:/usr/bin/X11"
POWERSTATE="/var/lib/acpi-support/powerstate"

getXuser() {
        user=`finger| grep -m1 ":$displaynum " | awk '{print $1}'`
	if [ x"$user" = x"" ]; then
		user=`finger| grep -m1 ":$displaynum" | awk '{print $1}'`
	fi
	if [ x"$user" != x"" ]; then
        	userhome=`getent passwd $user | cut -d: -f6`
        	export XAUTHORITY=$userhome/.Xauthority
	else
		export XAUTHORITY=""
	fi
}

getXconsole() {
	console=`fgconsole`;
	displaynum=`ps t tty$console | sed -n -re 's,.*/X .*:([0-9]+).*,\1,p'`
	if [ x"$displaynum" != x"" ]; then
		export DISPLAY=":$displaynum"
		getXuser
	fi
}

getState() {
        /usr/bin/on_ac_power
        if [ "$?" -eq 1 ]; then
                STATE="BATTERY"
        else
                STATE="AC"
        fi
}
        
#check our state has actually changed
checkStateChanged() {
# do we have our state stashed?
        if [ -f "$POWERSTATE" ]; then
                OLDSTATE=$(<$POWERSTATE) 
                if [ "$STATE" = "$OLDSTATE" ]; then
                       exit 0
                else
#stash the new state
                        echo "$STATE" > $POWERSTATE
                fi
        else
#we need to stash the new state
                echo "$STATE" > $POWERSTATE
        fi
}

LAPTOP_MODE='/usr/sbin/laptop_mode'
HDPARM='/sbin/hdparm -q'

LIDSTATE='/var/lib/acpi-support/lidstate'
EDIT: /varlib/acpi-support/lidstate doesn't exist

Last edited by lupusarcanus; 12-21-2009 at 04:45 PM.
 
Old 12-22-2009, 10:28 AM   #18
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
Have you looked for bios updates? Maybe something saying "we screwed up the acpi event mappings" or enabling battery polling?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to disable "last login log" & disable "last login message" when start login. hocheetiong Linux - Newbie 4 02-08-2011 06:35 AM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 12:26 PM
"Click Here to Find Similar Threads" Greatest Feature Ever calid LQ Suggestions & Feedback 2 07-01-2009 12:58 PM
How do I disable "shutdown" and "restart" options in KDE logout screen for all users? maxgsp Linux - Distributions 1 12-12-2008 04:18 PM
LXer: amaroK"Fast Forward" Feature Guide LXer Syndicated Linux News 0 04-18-2006 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:50 AM.

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