Skip to content

Brightness

Brightness information about screen or led brightness levels in percent. Allows to change the respective value via scrolling.

Example

{
end = [
{
type = "brightness"
format = "{percentage}%"
smooth_scroll_speed = 0.5
mode.type = "systemd"
mode.subsystem = "backlight"
mode.name = "amdgpu_bl1"
profiles.low.when = 25
profiles.low.format = "{percentage}%"
profiles.low.icon_label = ""
profiles.high.when = 100
profiles.high.format = "{percentage}%"
profiles.high.icon_label = ""
}
]
}

Configuration

Type: brightness

The format string to use for the widget button label.

The following tokens can be used:

TokenDescription
{percentage}The active brightness percentage.

Type: string
Default: {percentage}%

The icon to show on the bar widget button. Supports image icons.

Type: string
Default: None

Whether the default profile map should be merged in.

Type: boolean
Default: true

Where to get the brightness data from

See [BrightnessDataSource].

Default: None

using the keyboard dbus. Note: this only works for keyboards, not for screen brightness.

using the login1 dbus and fs for reading. This works for keyboard and screen brightness, but needs the filesystem for reading the data and dbus for adjusting.

Object keys

The subsystem to read the data from, e.g. backlight or leds. Subsystem refers to the directory within /sys/class/.

Type: string
Default: None

The name of the resource, see /sys/class/<subsystem> for available resources. If empty, ironbar will try to resolve it via a hardcoded list of common resources

Type: string
Default: None

See truncate options.

Default: None

Do not truncate content.

Setting this option may cause excessively long content to overflow other widgets, shifting them off-screen.

{ truncate = "off" }

Auto mode lets GTK decide when to ellipsize.

To use this mode, set the truncate option to a string declaring the location to truncate text from and place the ellipsis.

{ truncate = "start" }

Length mode defines a fixed point at which to ellipsize.

Generally you will want to set only one of length or max_length, but you can set both if required.

{
truncate.mode = "start"
truncate.length = 50
truncate.max_length = 70
}
Object keys

The location to truncate text from and place the ellipsis.

Type: 'none' | 'start' | 'middle' | 'end'
Default: None

The fixed width (in characters) of the widget.

The widget will be expanded to this width if it would have otherwise been smaller.

Leave unset to let GTK automatically handle.

Type: integer (int32)
Default: None

The maximum number of characters to show before truncating.

Leave unset to let GTK automatically handle.

Type: integer (int32)
Default: None

The orientation to display the widget contents.

Type: 'horizontal' | 'vertical'
Default: 'horizontal'

The justification (alignment) of the widget text shown on the bar.

Type: 'left' | 'right' | 'center' | 'fill'
Default: 'left'

Icons

The icon is configured per profile using the icon_label option.

Brightness ships with default profiles that set icons for percentage ranges:

ProfileThreshold (<=)Icon
level05
level1015
level2025
level3035
level4045
level5055
level6065
level7075
level8085
level9095
level100100

Default profiles

{
level0.when = 5.0
level0.icon_label = ""
level10.when = 15.0
level10.icon_label = ""
level20.when = 25.0
level20.icon_label = ""
level30.when = 35.0
level30.icon_label = ""
level40.when = 45.0
level40.icon_label = ""
level50.when = 55.0
level50.icon_label = ""
level60.when = 65.0
level60.icon_label = ""
level70.when = 75.0
level70.icon_label = ""
level80.when = 85.0
level80.icon_label = ""
level90.when = 95.0
level90.icon_label = ""
level100.when = 100.0
level100.icon_label = ""
}

Styling

SelectorDescription
.brightnessBrightness widget button
.brightness .labeltext, which is controlled via format
.brightness .iconicon, which is controlled via icon_label

For more information on styling, please see the styling guide.