Elementary OS Juno. Dell Inspiron 5767. I try to prevent my laptop from suspend after some time of inactivity. I choose "Never" in both Plugged In and On Battery, but Laptop still suspend after some time. And it cannot connect to my wifi network after wake up so I need to reboot laptop every time. Is there any other ways to change this option?
Got exactly the same issue on Juno stable, and found the solution here: https://superuser.com/a/1315412
The problem basically comes down to the fact that the power settings are not propagated to the 'lightdm' user, which is the active one on the login screen.
I fixed my issue as follows, copied from the answer in the above link:
su -s /bin/bash lightdm
dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type
dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout
This prints 'suspend' and '1200', respectively.
To turn off suspension, set:
dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type nothing
UPDATE: If you're getting the No protocol specified issue, as @ankscorek and I ran into after upgrading to Juno 5.1.3, use the following command to add the lightdm user to the access control list:
sudo xhost +SI:localuser:lightdm
before changing to the lightdm user, so before all the above commands.
If above solution does not work (as is for me the case now as well this second time around), you can always ditch the pantheon greeter (as I did):
sudo apt install lightdm-gtk-greeter