Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is there a way to inhibit suspend/hibernate from the command line. I want to ssh into my home computer and not have it suspend while I'm working on it.

share|improve this question
    
Which version of Ubuntu is the remote machine running? –  Anarci Oct 25 '11 at 17:01
    
The remote machine is running Gnome on Ubuntu 11.10. –  user1477 Oct 25 '11 at 17:37
    
Is it an Ubuntu Server or desktop install? Are you sure the ssh connection is not just dying? Trying enabling keepalive and see if that makes a difference –  Anarci Oct 26 '11 at 10:34

3 Answers 3

You might want to disable power management in gnome-control-center.

share|improve this answer
    
Normally, I want my computer to suspend. It's a laptop and all. But when I ssh into it, I'd like suspend to be temporarily inhibited. –  user1477 Oct 25 '11 at 17:38
2  
Hm, perhaps find out which gconf (or dconf, in this brave new 11.10 world) keys enable/disable suspend, then write a couple of shell scripts to change them to enable/disable suspend from the command line. –  Marius Gedminas Oct 25 '11 at 19:30

You also might want to try this script 1, it inhibits to suspend/turn off your machine, I use it when watching movies.

img

1 http://linuxtidbits.wordpress.com/2009/09/08/movietime-stop-powersaving-to-watch-a-movie/

share|improve this answer

Use xdotool instead:

sudo apt-get install xdotool

Then, in a bash loop like this

while true ; do
    DISPLAY=:0.0 xdotool key Shift_L   # send a "harmless" keypress to Xorg
    sleep 5                            # wait a little bit and do it again
done
share|improve this answer

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.