i3status_rs::blocks

Module backlight

source
Expand description

The brightness of a backlight device

This block reads brightness information directly from the filesystem, so it works under both X11 and Wayland. The block uses inotify to listen for changes in the device’s brightness directly, so there is no need to set an update interval. This block uses DBus to set brightness level using the mouse wheel, but will fallback to sysfs if systemd-logind is not used.

§Root scaling

Some devices expose raw values that are best handled with nonlinear scaling. The human perception of lightness is close to the cube root of relative luminance, so settings for root_scaling between 2.4 and 3.0 are worth trying. For devices with few discrete steps this should be 1.0 (linear). More information: https://en.wikipedia.org/wiki/Lightness

§Configuration

KeyValuesDefault
deviceA regex to match against /sys/class/backlight devices to read brightness information from (can match 1 or more devices). When there is no device specified, this block will display information for all devices found in the /sys/class/backlight directory.Default device
formatA string to customise the output of this block. See below for available placeholders." $icon $brightness "
missing_formatA string to customise the output of this block. No placeholders available" no backlight devices "
step_widthThe brightness increment to use when scrolling, in percent5
minimumThe minimum brightness that can be scrolled down to5
maximumThe maximum brightness that can be scrolled up to100
cycleThe brightnesses to cycle through on each click[minimum, maximum]
root_scalingScaling exponent reciprocal (ie. root)1.0
invert_iconsInvert icons’ ordering, useful if you have colorful emojifalse
ddcci_sleep_multiplierSee ddcutil documentation1.0
ddcci_max_tries_write_readThe maximum number of times to attempt writing to or reading from a ddcci monitor10
PlaceholderValueTypeUnit
iconIcon based on backlight’s stateIcon-
brightnessCurrent brightnessNumber%
ActionDefault button
cycleLeft
brightness_upWheel Up
brightness_downWheel Down

§Example

[[block]]
block = "backlight"
device = "intel_backlight"

Hide missing backlight:

[[block]]
block = "backlight"
missing_format = ""

§calibright

Additional display brightness calibration can be set in $XDG_CONFIG_HOME/calibright/config.toml See https://github.com/bim9262/calibright for more details. This block will override any global config set in $XDG_CONFIG_HOME/calibright/config.toml

§D-Bus Fallback

If you don’t use systemd-logind i3status-rust will attempt to set the brightness using sysfs. In order to do this you’ll need to have write permission. You can do this by writing a udev rule for your system.

First, check that your user is a member of the “video” group using the groups command. Then add a rule in the /etc/udev/rules.d/ directory containing the following, for example in backlight.rules:

ACTION=="add", SUBSYSTEM=="backlight", GROUP="video", MODE="0664"

This will allow the video group to modify all backlight devices. You will also need to restart for this rule to take effect.

§Icons Used

  • backlight (as a progression)

Structs§

Functions§