🔍 See Original Answer on Ask Ubuntu 🔗
Disable suspend after screen lock
October 21, 2016
November 24, 2022
Copy to clipboard: false
You can try this. Open the terminal and type:
gksu gedit /etc/systemd/logind.conf
Set these two lines to look like this:
Save the file, reboot and test it under the two environments (docked and undocked).
If unacceptable results, change your power settings to “Do nothing” on the lid close event where you have it set to “Suspend” now. You shouldn’t have to reboot to test your two environments again.