simple brightness tool
  • C 82.7%
  • Nix 9%
  • Roff 4.2%
  • Makefile 4.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-15 07:19:09 +08:00
.forgejo/workflows init 2026-10-08 21:47:43 +08:00
.gitignore init 2026-10-08 21:47:43 +08:00
backlight.rules init 2026-10-08 21:47:43 +08:00
flake.nix init 2026-10-08 21:47:43 +08:00
LICENSE init 2026-10-08 21:47:43 +08:00
Makefile Misc: edit comments that state the obvious and add nothing to explaining the code itself 2026-10-15 07:19:09 +08:00
README.md init 2026-10-08 21:47:43 +08:00
sb.1 init 2026-10-08 21:47:43 +08:00
sb.c Misc: edit comments that state the obvious and add nothing to explaining the code itself 2026-10-15 07:19:09 +08:00

sb

CI

A simple brightness control for internal and external monitors

Usage

sb <output> <raise|lower|get> [step]

output is the DRM connector name: eDP-1, HDMI-A-1, DP-2, and so on. step is a brightness percentage, defaulting to 5 if you can't be bothered to specify one.

sb eDP-1 raise        # internal panel, +5%
sb HDMI-A-1 lower 10  # external monitor, -10%
sb DP-2 get           # current brightness percentage

raise and lower print the resulting brightness percentage to stdout, so callers can read the new value without a separate get call.

Building

make
make LDFLAGS="-static" # statically links the binary
make install  # installs to /usr/local/bin by default

(Requires make and a C compiler)

External monitor permissions

Your user needs access to /dev/i2c-*. Add yourself to the i2c group:

# Linux (most distros)
usermod -aG i2c $USER

Without this, sb will report cannot open /dev/i2c-N: Permission denied

License

CDDL Version 1.1