# Brightness (https://mangowm.github.io/docs/bar/modules/brightness)

Shows backlight brightness, read from `/sys/class/backlight` (auto-detected
or set with `device`). Updates immediately on external changes via udev.

```jsonc
"modules-right": ["backlight"],

"backlight": {
    "format": "{icon} {percent}%",
    "icons": ["󰃞", "󰃟", "󰃝", "󰃝", "󰃠", "󰃠", "󰃠"],
    "scroll-step": 2
}
```

## Options [#options]

| Option                            | Type         | Default | Description                                              |
| --------------------------------- | ------------ | ------- | -------------------------------------------------------- |
| `format`                          | string       | —       | Display format (see placeholders)                        |
| `icons`                           | string array | —       | Nerd-font icons shown by brightness level                |
| `device`                          | string       | auto    | Backlight device under `/sys/class/backlight`            |
| `scroll-step`                     | number       | `2`     | Percentage points to change per wheel tick               |
| `on-scroll-up` / `on-scroll-down` | string       | —       | Custom commands that replace the built-in wheel handling |

Wheel input changes the selected backlight directly. mangobar writes the
backlight sysfs value when possible and otherwise calls logind's
`Session.SetBrightness`, matching `brightnessctl`'s write path without
launching it. Configuring either scroll command replaces both built-in scroll
directions.

## Placeholders [#placeholders]

| Placeholder        | Description                                   |
| ------------------ | --------------------------------------------- |
| `{}` / `{percent}` | Brightness percent                            |
| `{icon}`           | Icon selected from the `icons` array by level |

## Styling [#styling]

```css
#brightness {
  background: linear-gradient(to top, #d3869b, mix(#d3869b, #fbf1c7, 0.3));
  color: #1b1a1a;
}
```