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

[SOLVED] I3lock on lid close


#1

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 ?


#3

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


#4

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!


#6

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


(Erin) #8

What did you find out please?


#9

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.


#11

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