#[SOLVED] put laptop to sleep on closing lid

12 messages · Page 1 of 1 (latest)

strange shell
#

how do i put my laptop to sleep when the lid is closed. it works sometimes but sometimes it doesnt and the it dies quickly. im on wayland btw

strange shell
#

update: i noticed that it only doesnt go to sleep if i lock it with swaylock before closing the lid. otherwise, if i dont lock and close the lid, it automatically goes to sleep every time without any issue. what should i do? also is there a way to make swaylock automatically lock the screen whenever the system goes to sleep?

quick knot
#

yes, exec swayidle -w before-sleep 'swaylock' in your config, that should trigger on suspend.

strange shell
#

Let me try

strange shell
#

im on hyprland and added exec-once = swayidle -w before-sleep 'swaylock' but it didnt lock

#

wait

#

nvm

#

it did work

#

i just had to restart hyprland after adding that to the config

subtle smeltBOT
#

Sano received a thank you cookie!