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.
-
Which version of Ubuntu is the remote machine running?– Ciaran LiedemanOct 25, 2011 at 17:01
-
The remote machine is running Gnome on Ubuntu 11.10.– user1477Oct 25, 2011 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– Ciaran LiedemanOct 26, 2011 at 10:34
Add a comment
|
3 Answers
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
You also might want to try this script 1, it inhibits to suspend/turn off your machine, I use it when watching movies.
1 http://linuxtidbits.wordpress.com/2009/09/08/movietime-stop-powersaving-to-watch-a-movie/
You might want to disable power management in gnome-control-center
.
-
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.– user1477Oct 25, 2011 at 17:38
-
3Hm, 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. Oct 25, 2011 at 19:30