Skip to content

brightness

Backlight control bar module.

Add it to your layout with brightness:

toml
[[bar.layout]]
monitor = "*"
right = ["brightness"]

General

FieldTypeDefaultDescription
level-iconsarray of string[...]Icons for brightness levels from low to maximum.
border-showboolfalseDisplay border around button.
icon-showbooltrueDisplay module icon.
label-showbooltrueDisplay percentage label.
formatstring"{{ percent }}%"Format string for the label.
label-max-lengthu320Max label characters before truncation with ellipsis. Set to 0 to disable.
thresholdsarray of ThresholdEntry[]Dynamic color thresholds based on brightness percentage.
More about level-icons

The percentage is divided evenly among icons. With 3 icons: 0-33% uses icons[0], 34-66% uses icons[1], 67-100% uses icons[2].

More about format

Placeholders

  • {{ percent }} - Brightness (0-100)

Examples

  • "{{ percent }}%" - "65%"
More about thresholds

Entries are checked in order; the last matching entry wins for each color slot. Use below for low-brightness warnings.

Example

toml
[[modules.brightness.thresholds]]
below = 20
icon-color = "status-warning"
label-color = "status-warning"

Colors

FieldTypeDefaultDescription
border-colorColorValue"yellow"Border color token.
icon-colorColorValue"auto"Icon foreground color. Auto selects based on variant for contrast.
icon-bg-colorColorValue"yellow"Icon container background color token.
label-colorColorValue"yellow"Label text color token.
button-bg-colorColorValue"bg-surface-elevated"Button background color token.

Click actions

FieldTypeDefaultDescription
left-clickClickAction"dropdown:brightness"Action on left click. Default opens the brightness dropdown.
right-clickClickAction""Action on right click.
middle-clickClickAction""Action on middle click.
scroll-upClickAction""Action on scroll up.
scroll-downClickAction""Action on scroll down.

Default configuration

toml
[modules.brightness]
level-icons = [
    "ld-sun-dim-symbolic",
    "ld-sun-medium-symbolic",
    "ld-sun-symbolic",
]
border-show = false
border-color = "yellow"
icon-show = true
icon-color = "auto"
icon-bg-color = "yellow"
label-show = true
label-color = "yellow"
format = "{{ percent }}%"
label-max-length = 0
button-bg-color = "bg-surface-elevated"
left-click = "dropdown:brightness"
right-click = ""
middle-click = ""
scroll-up = ""
scroll-down = ""
thresholds = []

Released under the MIT License.