Discussion:
[Fluxbox-users] fluxbox and suspend
Bob Hepple
2010-10-25 10:58:39 UTC
Permalink
Trying to get laptop suspend to work under fluxbox as well as it works under
gnome. I realise it's not a fluxbox function but I wonder if other fb users
have got this working well.

Under fb I've tried:

pm-suspend

pm-suspend --auto-quirks

dbus-send --system --print-reply --dest="org.freedesktop.UPower"
/org/freedesktop/UPower org.freedesktop.UPower.Suspend

That last one is from the pm-utils site - it takes two hits on the power
button to resume, sometimes kernel oops.

None of them work quite well - the auto-quirks one seems to be the best but
I still get a crash and reboot on resume about once every 5 suspends or
thereabouts.

Under gnome, it just never faults, comes up every time. I wonder what it
might be using to do the job.

This is all on fedora-fc13 on a generic Atom netbook.


Thanks


Bob
Rodrigo Javier Tobar Carrizo
2010-10-25 14:07:42 UTC
Permalink
Post by Bob Hepple
Under gnome, it just never faults, comes up every time. I wonder what it
might be using to do the job.
It uses the gnome-power-manager utility (the same that displays the AC
or battery icon on the gnome-applet). If you start that one under
fluxbox, you'll be able to use your computer's "sleep" button (or
similar) to suspend it. It has worked without problems for me during the
last 2 years.

Cheers!

Rodrigo
Bob Hepple
2010-10-26 04:04:08 UTC
Permalink
On Tue, Oct 26, 2010 at 12:07 AM, Rodrigo Javier Tobar Carrizo <
Post by Bob Hepple
Under gnome, it just never faults, comes up every time. I wonder what it
might be using to do the job.
It uses the gnome-power-manager utility (the same that displays the AC or
battery icon on the gnome-applet). If you start that one under fluxbox,
you'll be able to use your computer's "sleep" button (or similar) to suspend
it. It has worked without problems for me during the last 2 years.
Cheers!
Rodrigo
Interesting - it looks like my suspend button (Fn-F1 FWIW) isn't seen by
gnome-power-manager. In fact, xev(1) returns XF86Sleep - so I put this into
.fluxbox/keys:

XF86Sleep :ExecCommand mysleep

mysleep is just this:

xscreensaver-command -lock
[ -d /proc/acpi/battery/BAT0 ] && sudo pm-suspend --auto-quirks

On the other hand, g-p-m _does_ respond to my power button (which is an ACPI
event as Kevin says) - it hibernates.

/etc/acpi/actions/power.sh on fedora just looks to see if there is a
gnome-power-manager and exits if it find one. (Otherwise it does a shutdown
-h now). Presumably g-p-m then gets the event? How?

So if my lappy doesn't generate ACPI for the suspend key, how do I tell
g-p-m to go suspend? "pm-suspend --auto-quirks" doesn't seem to be enough.

Another interesting experiment - I can tie the power button to 'suspend'
instead of 'hibernate' in g-p-m and it looks like it works. I'll try it out
for a while and see if there is an improvement.




Hmmmmm



Thanks


Bob
Bob Hepple
2010-10-26 16:09:57 UTC
Permalink
Another interesting experiment - I can tie the power button to 'suspend' instead of 'hibernate' in g-p-m and it looks like it works. I'll try it out for a while and see if there is an improvement.
... well that didn't work out so well! Under fluxbox, when g-p-m wants
to suspend it thinks about it for about 5 seconds and then does the
business. Unfortunately it doesn't always come back up again.

Under gnome, by contrast, 'suspend' happens almost instantly and it
comes back up much more reliably. There is some secret business
happening here. Unfortunately, the man pages (upower, upowerd) and the
g-p-m online doco show almost no detail at all.

I tried using strace on g-p-m but it showed nothing that made much
sense, so state of play is that none of the following work reliably
for fluxbox:

gnome-power-manager

pm-suspend [--auto-quirks]

echo [-n] mem > /sys/power/state

dbus-send --system --print-reply --dest=org.freedesktop.Hal
/org/freedesktop/Hal/devices/computer
org.freedesktop.Hal.Device.SystemPowerManagement.Suspend

dbus-send --system --print-reply --dest="org.freedesktop.UPower"
/org/freedesktop/UPower org.freedesktop.UPower.Suspend

Looks like if I want reliable suspend, I'm going to have to stick with
gnome on the laptop - apart from the fact that gnome generally sucks,
it hurts doubly that the main reason I have to use it is that they've
failed to document what's going on under the covers. Gnomes don't do
'man' by the look of it! In fact, the freedesktop project seems to
have a general abhorrence to documentation.

Sigh! Can no-one save me from the clutches of gnome?


Bob

Continue reading on narkive:
Loading...