LaptopMode

Richard Hughes hughsient at gmail.com
Fri Sep 16 07:09:23 PDT 2005


On Fri, 2005-09-16 at 13:57 +0200, Christian Zoz wrote:
> On Fri, Sep 16, Richard Hughes wrote:
> > What's the difference between setting the kernel parameters in PowerSave
> > or HAL? 
> 
> That's very easy: 
> laptop-mode is some kind of power saving, isn't it.
> And HAL is a Hardware Abstraction Layer.
> Every distribution has some kind of power save management.

That's a good point, and after thinking about it, maybe the powersave
script should just be:

#!/bin/sh
read value

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

if [ -x /usr/bin/powersave ] ; then
    # Currently ALTLinux and SuSE
    if [ $value = "true" ]; then
        /usr/bin/powersave -e Powersave
        RET=$?
    elif [ $value = "false" ]; then
        /usr/bin/powersave -e Performance
        RET=$?
    fi
    RET=$?
elif [ -x /usr/sbin/pm-powersave ] ; then
    # Will be RedHat and Fedora
    /usr/sbin/pm-powersave $value
    RET=$?
else
    # TODO: add other scripts support
    unsupported
    fi

exit $RET





More information about the hal mailing list