SliTaz SliTaz Forum

You are not logged in.

#1 2012-03-24 17:36:45

the waiter
Member
Registered: 2012-03-24
Posts: 8

Suspend on lid close

Hello,

I am new here. I installed Slitaz just 2 days ago and I am surprised how fast and small it is. Nice.

I have no prblem with wifi, vga as some people have but I would like to solve ony one issue. Is it possible to make sleep my notebook by closing lid? It does not work. I have tried something with pm-utils. It suspend PC but does not wake up. I get just black screen. What is your experience?

Thanx for quick answer...

Offline

#2 2012-03-24 20:46:12

domcox
Administrator
Registered: 2011-03-29
Posts: 104

Re: Suspend on lid close

Hi,

As you have installed pm-utils, I suggest you to try to suspend/resume your notebook from the command line:

[c]# pm-suspend[/c]
You certainly have to press the power button to resume from suspend.

If suspend did not work correctly, you will find some valuable information in the log file /var/log/pm-suspend.log.

Check also the output of:

[c]# pm-is-supported --suspend ; echo $?[/c]
This command will do some sanity checking and report any errors it finds in your configuration. If it says '0', your configuration is ok.

If suspend/resume is ok, add the following sequence in .config/openbox/rc.xml (current user) and /etc/xdg/openbox/rc.xml (future users) at the end of the keyboard section. Edit both files, search for </keyboard> and insert:

[c]<keybind key="XF86Sleep">
    <action name="Execute">
        <startupnotify>
            <enabled>true</enabled>
            <name>Suspend</name>
        </startupnotify>
        <command>
            dbus-send --system --print-reply --dest=org.freedesktop.Hal
            /org/freedesktop/Hal/devices/computer
            org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0
        </command>
    </action>
</keybind>[/c]
It will suspend your notebook when the lid closes.

Run

[c]# xev[/c]
to find out what key binding to use for laptop lid closure. Its maybe not XF86Sleep.

The dbus-send command:

[c]dbus-send --system --print-reply --dest=org.freedesktop.Hal
            /org/freedesktop/Hal/devices/computer
            org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0[/c]
allow a regular user to suspend without the need for a root password.

Offline

#3 2012-03-25 08:37:19

the waiter
Member
Registered: 2012-03-24
Posts: 8

Re: Suspend on lid close

Thanx for answer

Your solution does work. When I close lid, it suspend my ntb. Problem is it does not resume. As I wrote above, only black screen remains.

Offline

#4 2012-03-26 19:06:16

domcox
Administrator
Registered: 2011-03-29
Posts: 104

Re: Suspend on lid close

ok, if you run manually:

[c]# pm-suspend[/c]
and suspend/resume is ok, but resume is broken with bindings in Openbox, then it's safer to use acpid.

Install acpid:

[c]# tazpkg get-install acpid[/c]
then edit /etc/acpi/button.sh as following:

[c]lid)
    if [ -e /usr/sbin/pm-suspend ] ; then
        logger "Event: button/lid - suspending"
        /usr/sbin/pm-suspend
    else
        logger "Event: button/lid - /usr/sbin/pm-suspend not found, skipping.."
    fi
;;
esac[/c]
Hope it works.

Offline

#5 2012-03-26 20:16:38

domcox
Administrator
Registered: 2011-03-29
Posts: 104

Re: Suspend on lid close

I'm afraid it won't work, acpid is actually broken and needs fixes.

Offline

#6 2012-03-28 19:44:12

the waiter
Member
Registered: 2012-03-24
Posts: 8

Re: Suspend on lid close

I see. What happend? Is there any chance to fix it in the future?

Offline

#7 2012-03-28 20:28:26

domcox
Administrator
Registered: 2011-03-29
Posts: 104

Re: Suspend on lid close

Yep! Work in Progress..

Offline

#8 2012-03-28 20:34:13

the waiter
Member
Registered: 2012-03-24
Posts: 8

Re: Suspend on lid close

Thanx Domcox, just let me know then smile

Offline

#9 2012-03-30 12:34:03

domcox
Administrator
Registered: 2011-03-29
Posts: 104

Re: Suspend on lid close

Hi!

acpid should be fixed.

Changes committed in wok changeset 12209:fa389f5b7eb9.

acpid is now configured to allow a notebook to enter in Sleep mode by closing the lid.

--

dom

Offline

#10 2012-03-31 11:40:29

the waiter
Member
Registered: 2012-03-24
Posts: 8

Re: Suspend on lid close

Hmm, unfortunately does not work for me. Still black screen after resume...

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]