LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 09-21-2009, 05:04 AM   #1
TwinReverb
Member
 
Registered: Sep 2008
Location: Misawa AB, Japan
Distribution: Slackware
Posts: 191
Blog Entries: 2

Rep: Reputation: 40
hooks in xfce4-power-manager


All,

Are there any hooks I can install into either xfce4-power-manager or the underlying system to launch an hdparm and/or sysctl command from the same script(s) it calls to make the CPU go into max power savings (when on battery) and into max performance (when on AC power)? I'm asking because I'm not sure if I want to do this as a feature request or not. Thanks!
 
Old 09-21-2009, 05:44 AM   #2
TwinReverb
Member
 
Registered: Sep 2008
Location: Misawa AB, Japan
Distribution: Slackware
Posts: 191
Blog Entries: 2

Original Poster
Rep: Reputation: 40
Found the answer:

edit /usr/lib/hal/scripts/linux/hal-system-power-set-power-save-linux and add some lines....

Code:
#!/bin/sh

value=$1

unsupported() {
        echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
        echo No powersave method found >&2
        exit 1
}

# We only support pm-utils
if [ -x "/usr/sbin/pm-powersave" ] ; then
        if [ $value = "true" ]; then
                /usr/sbin/pm-powersave true
                # Added: put hard drive in high power saving
                hdparm -B 1 /dev/sda
                # Added: we're going into laptop mode
                echo 5 > /proc/sys/vm/laptop_mode
                RET=$?
        elif [ $value = "false" ]; then
                /usr/sbin/pm-powersave false
                # Added: put hard drive in high performance
                hdparm -B 254 /dev/sda
                # Added: come out of laptop mode
                echo 0 > /proc/sys/vm/laptop_mode
                RET=$?
        fi

else
        # cannot set proc stuff here, so error out
        unsupported
        fi 

exit $RET
 
  


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
XFCE Power Manager mlpa Slackware 1 09-01-2009 03:29 AM
upgrade to slackware 12.2 + xfce4.6 (xfce4-power-manager doesn't work) zux Slackware 4 04-22-2009 11:28 AM
power manager jahanzeb1982 Linux - Hardware 1 04-01-2008 08:40 AM
where is gnome-power-manager? panagopoulos Linux - Software 0 04-29-2006 07:50 AM
Power Manager on Mandrake 9.2 blandman Linux - Laptop and Netbook 8 04-16-2004 11:22 AM


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

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 Google+: linuxquestions
Open Source Consulting | Domain Registration