My ubuntu 20.04 laptop used to always suspend wen the lid was closed, UNTIL I plugged in a monitor for the first time. I realized this error AFTER I unplugged the monitor. I think that the monitor has broken Ubuntu.
Current behavior:
It seems like every other time I close the lid, it suspends. It's not exactly every other time, but you get the point.
For times when it DOESN'T suspend, it clearly knows something has just happened because when I open it, some elements in GNOME flash white-ish for a second, as if something refreshed. I am also sure that the screen doesn't turn off because I can see under the lid while it's closed.
Suspension itself still works because I am still able to click the suspend button in one of the buttons in the gnome top bar.
I know that there are other questions on this site about suspension problems, but this is different.
EDIT: I also found the file /etc/systemd/logind.conf
and it has parameters about laptop lid. I don't know which one is causing the problem, so here is the output of cat /etc/systemd/logind.conf
:
#This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# Entries in this file show the compile time defaults.
# You can change settings by editing this file.
# Defaults can be restored by simply deleting this file.
#
# See logind.conf(5) for details.
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
I installed tlp
and tlp-stat
on the same day that I connected a monitor for the first time, so the monitor could possibly have nothing to do with it and the problem could be caused by TLP. I'm not sure if I should uninstall tlp
because my laptop battery isn't very good with Ubuntu and tlp saves power. But if you think that it would solve the problem, I will uninstall it.
Another possible problem could be that systemd
thinks I'm "docked" (from output above: #HandleLidSwitchDocked=ignore
) and "ignore
s" it.
Ubuntu 20.04
DE: GNOME
laptop: Dell Inspiron 17 3000