Suspend And Resume On A FreeBSD Laptop

[home]

The Problem

When closing the lid of a laptop on FreeBSD, the screen will go blank and that is about it, the laptop will stay running as usual, what we really want is for the laptop to suspend when the lid is closed in order to save on battery. Unlike Linux, OpenBSD and other operating systems, FreeBSD does not provide this functionality by default.


The Solution

We must edit a file in /etc called /etc/sysctl.conf. This file should be present but empty by default on FreeBSD. All we need to add to this file is the line hw.acpi.lid_switch_state=S3, and reboot.

Alternativly, if you do not wish to reboot, running the command sysctl hw.acpi.lid_switch_state=S3 as root should provide this funtionality.

NOTE: I have only tested this on a ThinkPad X200 which is a very well supported laptop by nearly every single operating system, so your laptop might not work with this specific setting, I will update this page as I test this with other laptops.