Skip to content

Battery Module

Sam edited this page Jul 16, 2024 · 3 revisions

The battery module displays your current battery percentage, if present.

Using

Insert into the modules array.

Configuration

  • title -> (String) The module title.
  • format -> (String) The format used to display the module. Contains a singular {percentage} placeholder.
  • path -> (Optional/String) The battery to find, relative to /sys/class/power_supply/ - Will default to BAT0 if not specified.
  • title_color -> (Optional/String) Override the title color to be used.
  • title_bold -> (Optional/Bool) Make the title bold.
  • title_italic -> (Optional/Bool) Make the title italic.
  • seperator -> (Optional/Char) Override the separator to be used.
  • progress_left_border -> (Optional/Char) The left border character of the progress bar.
  • progress_right_border -> (Optional/Char) The right border character of the progress bar.
  • progress_progress -> (Optional/Char) The character used to fill in the progress bar.
  • progress_empty -> (Optional/Char) The character used to fill in empty space in the progress bar.
  • progress_target_length -> (Optional/Number) The target length of the progress bar.
  • decimal_places -> (Optional/Number) Override the decimal places to be displayed.
Default Configuration
[battery]
title = "Battery"
format = "{percentage}%"

Example

modules = [
    "battery"
]

[battery]
title = "Battery"
format = "{percentage}%"