Screen does not lock when closing laptop lid

Hey all,
Whenever I close my lid my laptop suspends but when I turn it back on it doesn’t show me any login screen.
I have already tried to change the logind.conf HandleLidSwitch = lock but it didn’t work
System : endeavouros + hyprland
Hyprdots : https://github.com/prasanthrangan/hyprdots
Any help is much appreciated!!

Wait… When you close your mouth, your laptop goes into sleep mode? What kind of tech is that? Also, why would you tear your laptop?

Jokes aside, have you read the wiki? → https://wiki.archlinux.org/title/Hyprland#Automatic_screen_locking_and_suspend


Automatic screen locking and suspend

Create the following script:

~/.config/hypr/scripts/sleep.sh

swayidle -w timeout 300 ‘swaylock -f -c 000000’ \ timeout 600 ‘systemctl suspend’ \ before-sleep ‘swaylock -f -c 000000’ &

Tip:

  • You can adjust the timeout periods by editing the numerical values, in seconds. 300 is 5 minutes, 600 is 10 minutes etc.
  • The script must be executable.

Then call it:

~/.config/hypr/hyprland.conf

… exec-once = ~/.config/hypr/scripts/sleep.sh …

EDIT: Just found this on the official Hyprland wiki → https://wiki.hyprland.org/Nvidia/#foreword

The nvidia-open drivers are still not up to feature parity with the proprietary drivers. One issue is with suspend (e.g. closing the lid on your laptop).

Are you using Nvidia?

Yup, I have nvidia :upside_down_face:

What’s the ouput of:

pacman -Q | grep -A 2 -E "(linux|nvidia)"

240622_01h44m01s_screenshot

Also how to change my screenshot manager from swappy to hyprshot

Check out either of the wikis from my first post for an answer to this question.

Note: When posting to the forum, screenshots should only be done if you can’t access your system and use copy and paste.

In the future, copy the text output from your terminal, paste in your reply, then select it again, and click the button highlighted below. This will format the text like it is in the terminal, and it also makes the text searchable and easier to read.


image


According to the GitHub link: https://github.com/NVIDIA/open-gpu-kernel-modules/issues/472, it looks like nvidia 555 fixes the issue for some users. However, this driver is currently in beta. In order to get that version, you’d have to replace your current driver.

Is this something you are willing to do?

Here is a link to the drivers you’d need. https://aur.archlinux.org/packages?O=0&K=nvidia-beta