Home | News | Download | Packages | Forum | Wiki | Github

[SOLVED] I3lock on lid close


Hi Voiders!

How can I lock my screen with i3lock when I close my laptop lid?

Checking the net I mostly find solution with systemd or a login manager that I don’t use (startx)

(Ioan) #2

is the HandleLidSwitch working for you ?


Try using acpid ?
Take a look at: /etc/acpi/handler.sh


Yes had a look there but it didn’t work for me … I guess this is run as root and how is handler.sh supposed to know about my X session?

Or maybe I’m stupid and didn’t try hard enough :p!


Yes I’m a retarded, it works :stuck_out_tongue: ! Sorry for all the noise!

(Erin) #8

What did you find out please?


edit the /etc/acpi/handler.sh and add i3lock command in the lid close section

(Erin) #10

Thanks for clarifying. Always useful for people trying to achieve similar in the future.


@Erin in this topic there’s another example of the use of handler.sh