Search | Running | Sailfish OS | All Posts | About Me

My FreeBSD laptop finally goes to sleep when closing the lid!

May 02, 2026 — Nico Cartron

I know, small victory!
So far, in order to have my X1 go to sleep when closing the lid, I had an alias that did:

nc_sleep='i3lock && doas zzz'

This was a small annoyance, so I spent 30 minutes to fix it. Turns out it was easy!

I just had to add an entry (e.g. lid.conf) in /etc/devd:

notify 100 {
match "system" "ACPI";
match "subsystem" "Lid";
match "notify" "0x01";
action "/usr/sbin/acpiconf -s 3";

};

then as root:

service devd restart

and upon closing the laptop, it went to sleep!

I just need to figure out how to lock the i3 session at the same time, and I'll be good!


Tags: FreeBSD


I don't have any commenting system, but email me (nicolas at ncartron dot org) your comments!
If you like my work, you can buy me a coffee!