You are not logged in.

#1 2012-12-17 18:37:49

Greed1sGood
Member
Registered: 2012-02-11
Posts: 44

[SOLVED] Thinkpad T420s - No suspend on lid close

I'm running Gnome 3.6.2 using only the DE power manager (no acpid or laptop tools). Systemd is configured to ignore lid close events, but the machine just won't suspend on lid close. I've went over the power configuration in dconf but it has no effect either.
Any help will be greatly appreciated as I've been struggling with this issue for quite some time now.

Last edited by Greed1sGood (2012-12-21 18:53:06)

Offline

#2 2012-12-19 20:48:35

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: [SOLVED] Thinkpad T420s - No suspend on lid close

Use systemd.

Offline

#3 2012-12-20 09:49:01

Mulan
Member
Registered: 2012-06-21
Posts: 9

Re: [SOLVED] Thinkpad T420s - No suspend on lid close

Yes I know this I think there is some problem with it on Gnomes side, that the options are not yet connected.
Like... Tweak tool does not seem to be able to affent power actions or something.
I am not sure wheather or not I overlook something I should comfigure, but for me gnome's power actions does not affect anything.

I do it like this::

 /etc/systemd/logind.conf:

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.
#
# See logind.conf(5) for details

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=hibernate
PowerKeyIgnoreInhibited=yes
SuspendKeyIgnoreInhibited=yes
HibernateKeyIgnoreInhibited=yes
LidSwitchIgnoreInhibited=yes

If you have a solution that will make power actios set in gnome (using tweaaktool or dconf-editor or whatever) please do tell.

Offline

#4 2012-12-20 15:05:39

Greed1sGood
Member
Registered: 2012-02-11
Posts: 44

Re: [SOLVED] Thinkpad T420s - No suspend on lid close

teateawhy wrote:

Use systemd.

systemd does work when I disable gnome power management from dconf. But it doesn't have a lot of options and it cannot detect battery ACPI events and so the most needed option for me is not available, which is: suspend on lid close only when operating on battery.

Mulan wrote:

I am not sure wheather or not I overlook steateawhyomething I should comfigure, but for me gnome's power actions does not affect anything.

gnome power management and the settings in the tweak tool indeed do not seem to have any effect even when all the options in systemd power settings are disabled.

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
PowerKeyIgnoreInhibited=yes
SuspendKeyIgnoreInhibited=yes
HibernateKeyIgnoreInhibited=yes
LidSwitchIgnoreInhibited=yes

Offline

#5 2012-12-21 18:51:37

Greed1sGood
Member
Registered: 2012-02-11
Posts: 44

Re: [SOLVED] Thinkpad T420s - No suspend on lid close

anyways I've written a little unsophisticated script using the default handler.sh structure:

#!/bin/bash

###########################################################
# Default acpi script that takes an entry for all actions #
###########################################################

#-----------------------
# Settings
#-----------------------

USER="username"

#-----------------------
# ACPI events 
#-----------------------

AC_STATE=$(cat /sys/class/power_supply/AC/online)

#-----------------------
# Functions
#-----------------------

function suspend ()
{
    sudo pm-suspend
}

function lockScreen ()
{
    DISPLAY=:0.0 su $1 -c "gnome-screensaver-command -l"
}

case "$1" in
    button/sleep)
        case "$2" in
            SLPB|SBTN)
                (lockScreen $USER) &
                suspend
		#logger 'SleepButton pressed'
                ;;
            *)
                logger "ACPI action undefined: $2"
                ;;
        esac
        ;;
    button/lid)
        case "$3" in
            close)
		(lockScreen $USER) &
                if [ "$AC_STATE" -eq "0" ]; then
	    	    suspend
		fi
                #logger 'LID closed'
                ;;
            open)
                #logger 'LID opened'
                ;;
            *)
                logger "ACPI action undefined: $3"
                ;;
    esac
    ;;
    *)
        logger "ACPI group/action undefined: $1 / $2"
        ;;
esac

# vim:set ts=4 sw=4 ft=sh et:

So I'll mark it as solved although gnome power manger apparently still does not handle lid close events.

Last edited by Greed1sGood (2012-12-21 18:52:52)

Offline

Board footer

Powered by FluxBB