Laptop won't go to sleep when lid closed [Hyprland]

Past experience:
-Garuda Linux with Hyprland
-laptop went to sleep when lid closed, saved a lot of battery, the battery could last days in sleep mode [without turning off the laptop]

The shift:
-BIOS got corrupted, but the issue got fixed easily, thanks to hp built in BIOS support
-I decided to switch to EndeavourOS + Hyprland

Current situation:
-EOS + Hyprland, I use this hyprland config called hyperdots
-Observations after closing, and then opening the lid:
-the screen comes to life from blank, without any login screen or lock (this is not a major issue)
-The WiFi seems to have turned off after closing the lid, and I need to turn it on again (not the major issue)
-The Bluetooth disconnects as well
-I can continue from where I left off

  • [THE PROBLEM] the battery drains really really fast, It drained from 40% to 9% in an hour with CLOSED LID !!! (earlier this 40% would drain to maybe 15% in 24hrs)

40% draining to 9% in a hour, i would consider normal, if the lid was open, because my refresh rate is 160Hz, but with the lid closed, this is just abnormal

my earlier garuda linux + minimal hyprland setup would last a little longer with open lid when compared to EOS + hyprdots, which i understand

but what explains this closed lid behaviour? I don’t think my battery is toast. I am pretty sure the laptop is not going to sleep properly

Can you check this file (here my config with Gnome behaving correctly - don’t know about Hyprland, but a good start to investigate

❯ cat /etc/systemd/logind.conf | grep Lid
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#LidSwitchIgnoreInhibited=yes

These are defaults - uncomment and change if it differs. But as said Hyprland might override settings eventually.

I get the same thing

> cat /etc/systemd/logind.conf | grep Lid
#HandleLidSwitch=suspend
#HandleLidSwitchExternalPower=suspend
#HandleLidSwitchDocked=ignore
#LidSwitchIgnoreInhibited=yes

should I try uncommenting them and see if anything changes?

[THE ISSUE GOT FIXED]
-I fixed the dual boot issue- where my PC would boot straight to windows, even though EOS was above Win in UEFI boot order-
-i installed some updates from Win11 settings, which seem to have updated the firmware as well, and I changed the UEFI boot order using a 3rd party tool, which fixed my dual boot issue

And all this have also fixed my battery issue, its working as intended now

1 Like

Glad it works now.

Uncommenting does not change anything - the commented lines are the defaults. Makes only seonse to uncomment if you change the value to sth. different.

A line like:
HandleLidSwitch=ignore
would have explained the behaviour of your laptop as well.

1 Like

Unfortunately, the problem is back.
This time I have an extra observation:

  1. The LED of my wired mouse keeps blinking in a set pattern when the lid is closed, whereas ideally, the LED should be OFF when the lid is closed.
    Here’s the video: https://streamable.com/bn52lr [note: moving the camera closer is not related to the mouse blinking]

  2. The very first lid close after a fresh boot, works fine.
    but any successive lid closes after that, they don’t work fine, I get the blinking thing and the battery drains

should I try to replace systemd with some other package?