Workaround to make Ubuntu not suspend when laptop lid is closed
- Edit the login.conf
/etc/systemd/logind.conf
2.Inside of the conf
logind.conf
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#UserTasksMax=12288
Options
HandleLidSwitch=lock – lock when lid closed.
HandleLidSwitch=ignore – do nothing, some laptops will disconnect Wi-Fi.
HandleLidSwitch=poweroff – shutdown.
HandleLidSwitch=hibernate – hibernate Ubuntu.
Please Change the following three options
HandleLidSwitch=ignore