Wake up from sleep by only keyboard/mouse activity Ubuntu 18.04

Solution 1:

Thanks a lot to @PRATAP for help reaching this answer.

  1. Install dconf-editor

sudo apt-get install dconf-editor

  1. Run it from terminal:

dconf-editor

  1. Go to settings-daemon/plugins/power/sleep-inactive-battery-type. Set Use default value to OFF, and Custom value to blank.

enter image description here

  1. To get the same behavior when laptop is connected to power - go instead to settings-daemon/plugins/power/sleep-inactive-ac-type, and do same as in 3.