[PATCH powerd] Fix config_SLEEP_WHEN_LID_CLOSED

Paul Fox pgf at laptop.org
Wed May 23 16:33:12 EDT 2012


sascha wrote:
 > Since 792c7dd3 powerd stays asleep by default while the lid is
 > closed. That's important for some use cases (putting suspended laptops
 > inside a charging rack), but breaks config_SLEEP_WHEN_LID_CLOSED=false
 > unless the new configuration option config_WAKE_WHEN_LID_OPEN has been
 > explicitly set to true by the user. As this option isn't present in
 > the configuration file where powerd was updated rather than freshly
 > installed, it takes them some time to figure out why
 > config_SLEEP_WHEN_LID_CLOSED doesn't work anymore.
 > 
 > Since the user has no expectation of the laptop going to sleep at all
 > when closing the lid if config_SLEEP_WHEN_LID_CLOSED is set to false,
 > it's safe to always enable config_WAKE_WHEN_LID_OPEN in that case.

if config_SLEEP_WHEN_LID_CLOSED is false, the user presumably used
the power button to put the laptop to sleep.  i'm not sure why they
should expect it to wake on lid open.  i appreciate the issue for a
user that's done an upgrade, but i'm not convinced that having
"sleep-on-close == false" should imply "wake-on-open == true".

perhaps i'm missing a subtlety.

paul

 > 
 > Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
 > ---
 >  powerd |    3 +++
 >  1 file changed, 3 insertions(+)
 > 
 > diff --git a/powerd b/powerd
 > index a9bba10..657744e 100755
 > --- a/powerd
 > +++ b/powerd
 > @@ -2543,6 +2543,9 @@ read_config()
 >  
 >      wake_on_open=$(yes_or_true_to_boolean "$config_WAKE_WHEN_LID_OPENED")
 >  
 > +    if [ -z "$sleep_on_close" ] ; then
 > +	wake_on_open=true
 > +    fi
 >  }
 >  
 >  battery_shutdown()
 > -- 
 > 1.7.10

=---------------------
 paul fox, pgf at laptop.org



More information about the Devel mailing list