I have an external monitor connected to my Dell XPS 13 9350 laptop. Whenever I close my laptop lid, the laptop's monitor will turn off but the external monitor will stay on and become the primary monitor. I tested what happens when I close the lid without an external monitor and found out that there is a 20-30 second delay before the laptop will suspend. If I close the lid and open it again within 10-15 seconds, the laptop will not even lock. I am wondering if this delay is the reason why my laptop will not suspend with an external monitor?
Someone with a similar computer asked a similar question here: Ubuntu 18.04 + Dell XPS 9360 = Suspension doesn't work when I close the lid
That doesn't appear to be the same problem, though, as their computer wouldn't suspend at all. I did try many of the suggestions.
My computer is going into a "deep" sleep and not "s2idle" mode. When I run sudo journalctl | grep "PM: suspend" | tail -2
, I get the following result:
Feb 11 14:09:11 MyComp kernel: PM: suspend entry (deep)
Feb 11 14:09:17 MyComp kernel: PM: suspend exit
I tried editing /etc/systemd/logind.conf
and uncommenting the following 2 lines so that it reads:
HandleLidSwitch=suspend
HandleLidSwitchDocked=suspend
I also tried to create /etc/systemd/sleep.conf
as mentioned in one of the answers in the link above, but nothing changed.
I don't have nVidia graphics, so any solution for nVidia graphic cards doesn't help me. If it helps, my graphics card is Intel HD Graphics 520 (Skylake GT2).
I downloaded the Gnome Tweaks tool and made sure the "Suspend when laptop lid is closed" setting under Power is turned on.
If it helps, I am using kernel 4.15.0-45-generic.
I know it's not a hardware issue as my computer is a dual boot with Windows 10, and my laptop has not problem going to sleep when I close the lid with or without an external monitor on Windows 10.
Mainly, I would like to close my laptop and it puts my computer to sleep without having to unplug the external monitor. The delay in my laptop suspending without an external monitor is something I can live with.