Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to use the hybrid suspend method instead of suspend when closing the lid or selecting "Suspend" from the menu.

I can imagine to change the pm-suspend script to do so automatically, but there might be a more maintainable / easier way.

share|improve this question

2 Answers

I am using the following pm-utils configuration to change $METHOD to suspend_hybrid, if it is "suspend":

% cat /etc/pm/config.d/00-use-suspend-hybrid
# Always use suspend_hybrid instead of suspend
if [ "$METHOD" = "suspend" ]; then
  METHOD=suspend_hybrid
fi

You might want to make sure that the hybrid method is supported on your system via the following code. If it says "0" it should work:

sudo pm-is-supported --suspend-hybrid && echo $?

Patrick Dickey adds:

So, in order to set a specific hibernate delay, you would add this code instead of the code mentioned in the article (under the sudo -e /etc/pm/config.d/00-use-suspend-hybrid command)

# Always use suspend_hybrid instead of suspend
if [ "$METHOD" = "suspend" ]; then
    METHOD=suspend_hybrid
fi
PM_HIBERNATE_DELAY=XX

Where, XX is the number of seconds that you want (for example "PM_HIBERNATE_DELAY=300" for 5 minutes)

share|improve this answer
1  
one small note, instead of 'sudo pm-is-supported --suspend-hybrid && echo $?', use 'sudo pm-is-supported --suspend-hybrid ; echo $?' as the return value of pm-is-supported is 0 for is supported, and 1 for is not. – James Caccese Aug 3 '12 at 17:50
1  
@JamesCaccese: In shellscript world, 0 means "true" and anything else means "false". Your scriptlet would work, but the original poster's scriptlet would work as intended as well, printing a '0' on supported and nothing on unsupported. If you want something that will always say supported or unsupported, try 'sudo pm-is-supported --suspend-hybrid && echo "supported" || echo "unsupported"' – zanfur Oct 28 '12 at 4:01

In 12.04 I noticed that when hibernation is triggered (using PM_HIBERNATE_DELAY=XX), the resume/thaw the shell scripts do not unset the grub recordfail variable. Therefore grub does not autoboot.

Timeout is set to -1 and it awaits user selection. I am guessing this requires some editing of scripts in /etc/pm/sleep.d/10_grub-common. Am a novice so I haven't dabbled to figure out the exact change unfortunately.

share|improve this answer
1  
Would be worth a bug report probably and/or testing if it works in 12.10+. – blueyed Nov 16 '12 at 17:21
I see the same problem in 12.10 – MDCore Dec 16 '12 at 10:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.