I can offer a workaround to this
Never mind the settings in the GUI, you can lock your screen and send your screens into standby via the command line
To lock your screen you could use
gnome-screensaver-command -l
or (if don't use gnome3)
xdg-screensaver lock
and to turn off your monitors (standby) you could use
xset dpms force off
Now, since you don't want to do this manually, but after a couple of minutes idle time, we need to find out how long you have been idle.
This can be done with xprintidle
sudo apt-get install xprintidle
xprintidle
will return miliseconds of (xserver) idletime
Now, lets combine this into a script(*). Use your favorite editor to copy/paste the following, modifying the IDLE_TIME
to your liking
nano /home/yourusername/idle_stby_lock_screen.sh
#!/bin/sh
# Wanted trigger timeout in milliseconds.
IDLE_TIME=$((5*60*1000)) # replace the '5' with how many minutes you'd like
# Sequence to execute when timeout triggers.
trigger_cmd() {
echo "Triggered action $(date)"
}
sleep_time=$IDLE_TIME
triggered=false
while sleep $(((sleep_time+999)/1000)); do
idle=$(xprintidle)
if [ $idle -ge $IDLE_TIME ]; then
if ! $triggered; then
gnome-screensaver-command -l
export DISPLAY=:0; xset dpms force off
triggered=true
sleep_time=$IDLE_TIME
fi
else
triggered=false
# Give 150 ms buffer to avoid frantic loops shortly before triggers.
sleep_time=$((IDLE_TIME-idle+150))
fi
done
Then make it executable with
chmod +x /home/yourusername/idle_stby_lock_screen.sh
You can test it out on the commandline
/home/yourusername/idle_stby_lock_screen.sh
if you are content with it, you can add it to the startup of your Ubuntu, like described in these answers here or with the "Startup" app in Ubuntu - just make sure to use the absolute path to your script.
Best Answer
To prevent suspension change: all settings>power>Suspend when inactive for
To allow screen off, change: change all settings>brightness & lock>turn screen off when inactive for
To lock after a certain period or on screen off, change: all settings>brightness & lock>Lock screen after