2

I am running Ubuntu 16.04 and I would like to prevent my workstation from sleeping even when nobody is logged localy on the machine. This workstation is often used through ssh.

I would like to set that through the command line.

Best regards, François

2 Answers2

4

Open the dash and search for power:

Unity dash searching for power

Open the "Power" option.

Pick the following options:

System power settings set to not suspend or sleep

That should do it.

Azendale
  • 12,021
2

Terminal CLI method

OP requests a CLI (Command Line Interface) methodology.

For battery timeout:

gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout <time_in_seconds>

For AC timeout:

gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout <time_in_seconds>

So for both Battery and A/C set the time to 0 (never).

For Login screen:

gsettings set org.gnome.desktop.screensaver idle-activation-enabled false