0

I am using a Xiaomi Mi Notebook Pro laptop. It is currently connected to an external monitor. It goes into sleep mode easily and I can't get out of it with the laptop lid closed. How can I fix this so that I can wake up from sleep mode when the laptop is closed?

My system details:

Linux 6.2.0-35-generic
Ubuntu 23.04
i5-8250U × 8
UHD Graphics 620 / (NVIDIA GeForce 150MX) but it is not displayed

I've tried everything but the keyboard and mouse do not wake up the system.

TommyPeanuts
  • 1,079

1 Answers1

0

To disable Ubuntu doing anything closing the laptop lid:

Open the /etc/systemd/logind.conf file in a text editor as root, for example,

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

If HandleLidSwitch is not set to ignore then change it:

 HandleLidSwitch=ignore

Make sure it's not commented out (it is commented out if it is preceded by the symbol #) or add it if it is missing.

Restart the systemd daemon (be aware that this will log you off) with this command:

sudo systemctl restart systemd-logind

For GNOME:

If you are using GNOME (the default in 18.04+), then you can do this easily without changing system settings by using the "Gnome Tweak Tool". It can be installed from the Ubuntu Software Store (It is called GNOME Tweaks). Or if you prefer the console:

Ubuntu 18.04

sudo apt-get install gnome-tweak-tool

Ubuntu 20.04+

sudo apt-get install gnome-tweaks

Run it after installing turn off the setting to do nothing when the lid is closed.

gnome-tweaks

Ajay
  • 1,246
  • thanks for the help, but it's all set up. I need the laptop to be fashionable to turn on and off with the lid closed. wake up via usb – Greemka4 Oct 27 '23 at 09:46
  • 1
    So you wanna use the laptop like a "CPU", right?? – Ajay Oct 27 '23 at 09:56
  • Yes , you got it right – Greemka4 Oct 27 '23 at 10:01
  • @Greemka4, you can try updating your OS to 23.10 which by default gives the feature you are asking for. I can close my laptop and still use the system on my external monitor. – Ajay Jan 10 '24 at 04:39