Page MenuHomeFreeBSD

rc: add a backlight service to save/restore backlight levels
AcceptedPublic

Authored by kevans on Tue, Sep 1, 3:41 AM.

Details

Reviewers
bapt
manu
ivy
Summary

The default on my laptop is annoyingly bright, and this is a useful feature to
mitigate that. The backlight script is largely a copy of the mixer
service which provides the same value for mixers, but this one is
specifically dependant on kld to allow DRM drivers a chance to attach.

Relnotes: maybe

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 76374
Build 73257: arc lint + arc unit

Event Timeline

kevans requested review of this revision.Tue, Sep 1, 3:41 AM
libexec/rc/rc.d/backlight
4

this is weird, I bet this comes from copy/paste from rc.d/mixer, but you can probably right your own here (and use SPDX)

31

You probably want required kld not provide kld

arrowd added inline comments.
libexec/rc/rc.conf
45

Enabling this by default will clash with DEs doing their own backlight management.
But unless user call save manually, I think it should really get in the way.

libexec/rc/rc.d/backlight
73

I'd prefer /var/db/backlight/... or /var/db/backlight-${1}-state

libexec/rc/rc.conf
45

I'm cool with off-by-default, I'll just want to amend backlight(8) to mention that the cpability exists for th rest of us.

libexec/rc/rc.d/backlight
31

*sigh* EDOOFUS at the last minute

73

The naming here forces them to be /var/db/backlightN-state because I wanted to explicitly ignore aliases up in list_backlights. That said, I have no objection to /var/db/backlight and I've somewhat wished that mixer did the same.

kevans marked 4 inline comments as done.

Review feedback:

  • Scope the backlight settings off into /var/db/backlight
  • Turn it off by default, mention it in the manpage
  • Condense the license/copyright header down and fix the PROVIDE/REQUIRE
  • Use my preferred quoting style while we're here

Thanks, my annoying 30% default backlight level will soon be history.

This revision is now accepted and ready to land.Tue, Sep 1, 1:49 PM

looks fine from the pkgbase side.

Can you put this in rc.conf.5 too?