Is there a shortcut to put gnome to sleep without locking the screen?
I know of the Meta+L (and some other combo) to lock the screen which makes the screen go to sleep pretty quickly.
However, I'd like to put my computer screen to sleep but not lock it.
Is there a way to have a hotkey do that under Gnome Ubuntu 18.04?
41 Answer
First, in settings - Screen Lock, turn "Screen Lock" off to disable the lock screen from automatically kicking in after a period of inactivity, or when you return from "sleep" state.
To make Super+L blank the screen, first disable its default assignment in "Settings" - "Keyboard shortcuts" (Click the entry, press Backspace to clear the assignment and click "Set" to finish.
Then, under custom shortcuts, create a new shortcut key (click "+" at the bottom). As "Command", specify
sh -c 'sleep 1 && xset dpms force off'and assign your desired shortcut key.
The "sleep" command is needed to give you time to release the keys. Otherwise, the xset command is executed, but as you release keys, the screen will be unblanked already.
1