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?

0

4 Answers 4

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.

3
  • 2
    Sorry but my laptop is neither docked, nor I am using a docking station. I want to close the lid and switch the screen off but still stay connected with the wifi network. Even then I tried this solution and somehow this too doesnt work, Sep 28, 2016 at 13:01
  • The screen will switch off regardless of whether sleep is enabled. There is a magnetic sensor within the frame of the screen. You can't keep the wifi on and also use suspend. Is your computer suspending when you close the lid? The wifi shouldn't disconnect if its not suspending.
    – negusp
    Sep 28, 2016 at 14:41
  • 1
    Nope my computer doesn't suspend as I can play the songs when the lid is closed, but somehow the wifi is switched off and it doesnt even start automatically when I open the lid again Sep 29, 2016 at 12:37
1

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.
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.

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .