Laptop users of OpenBSD know that there's no built-in functionality for keeping the display's brightness persistent across reboots. It's possible to use rc(8) and wsconsctl(8) to write the display's brightness setting to a file on shutdown and read it during startup.
We'll start by creating /etc/rc.shutdown
(if it doesn't exist) and add the following to it:
and make it executable:/etc/rc.shutdown#!/bin/sh wsconsctl display.brightness | cut -f2 -d= > /var/brightness
On shutdown, the value of# chmod +x /etc/rc.shutdown
display.brightness
from wsconsctl
gets written to /var/brightness
.
Next, create /etc/rc.local
(if it doesn't exist) and add the following:
Make it executable:/etc/rc.local#!/bin/sh wsconsctl display.brightness=$(cat /var/brightness)
# chmod +x /etc/rc.local
During startup, wsconsctl
will set display.brightness
to the value in /var/brightness
.