6

I am running Ubuntu 16.04 and when the lid of my laptop is closed the wifi disconnects and needs to be turned on manually when the lid is opened.

I have tried the following without any success:

sudo -H gedit /etc/systemd/logind.conf, 

Add a line

HandleLidSwitch=ignore

IgnoreLid=true in /etc/UPower/UPower.conf

My settings in the power-manager are set to 'Do Nothing'.

Can you please help in identifying the issue?

Zanna
  • 72,312

4 Answers4

4

At first I didn't understand your question but then surmised if you are closing your lid and want WiFi to stay on that must mean you have your Laptop docked or have an HDMI monitor attached and the system is suspending the Wifi.

You already edited logind.conf once and need to again. Set the line:

HandleLidSwitchDocked=ignore

Then save the file and reboot. Hopefully this solves the problem. If so mark this as solution by clicking check mark, if not post a comment.

2

1.) Open terminal (press Ctrl+Alt+T on Gnome) from your system application menu. When it opens, run command:

sudo nano /etc/systemd/logind.conf

change/remove # it to one of following :

HandleLidSwitch=lock – lock when lid closed.
HandleLidSwitch=ignore – do nothing.
HandleLidSwitch=poweroff – shutdown.
HandleLidSwitch=hibernate – hibernate Ubuntu.
matinict
  • 267
0

I had a similar issue with an HP 250 G5. Power manager was also configured to do nothing (except turning off the display). Funny thing was that when I closed the lid, wifi continued to operate. However, as soon as I opened the lid, wifi was switched off.

I solved this by an acpi triggered script (see e.g. https://forums.fedoraforum.org/showthread.php?291877-Run-a-script-when-laptop-lid-opens-closes and don't forget to make the script executable) which runs "rfkill unblock wifi" whenever I open the lid. I guess you could do the same (maybe at closing the lid or for both events). It is not super clean, as it also activates wifi on such events even when it was turned off before, but it solved my problem.

Peace out.

Mik
  • 1
0

I had the same issue. What was happening was when I closed my laptop's lid, it went into a suspended state thereby shutting off my wifi (along with some other side effects).
What you can do is change the following:

  1. Go to the System Settings and select Power setting
  2. Change the When the lid is closed option to Do Nothing

That's it. Your wifi won't automatically disconnect now.

PS.
Additionally, you might still want a bit security after you reopen your laptop lid, so make sure you have the Lock turned On for Lock screen after with setting Screen turns off.