Support Multiple Batteries
Out of the box the bar shows the combined charge of all batteries: in the X11 session once the i3xrocks-battery package is installed, and in the Wayland session by default. For some laptops that have multiple batteries, e.g. ThinkPads, you may want to have each battery displayed.
i3
- Install the battery blocklet if it is not installed yet:
sudo apt install i3xrocks-battery- Stage your i3xrocks configuration files, including
80_battery, then open~/.config/regolith3/i3xrocks/conf.d/80_batteryin your editor of choice. Once~/.config/regolith3/i3xrocks/conf.dcontains files, the bar shows only the blocklets in that directory, so copy every blocklet you want to keep. - Find the line that pertains to the battery blocklet:
~/.config/regolith3/i3xrocks/conf.d/80_battery
# Battery indicator
#
# Displays total percentage charge left of specified battery.
# You can specify the instance by adding:
# instance=BAT0
[battery]
interval=10- List all the batteries on your machine by running:
upower --enumerate
# /org/freedesktop/UPower/devices/line_power_AC
# /org/freedesktop/UPower/devices/battery_BAT0
# /org/freedesktop/UPower/devices/battery_BAT1
# /org/freedesktop/UPower/devices/DisplayDevice- Update the staged config file to have one blocklet per battery, using the UPower device names (
battery_BAT0,battery_BAT1) as the instance:
~/.config/regolith3/i3xrocks/conf.d/80_battery
...
# Battery indicator
#
# Displays total percentage charge left of specified battery.
[battery]
interval=10
instance=battery_BAT0
[battery]
interval=10
instance=battery_BAT1- Refresh the bar:
regolith-look refreshSway
- Stage your i3status-rust config file:
mkdir -p ~/.config/regolith3/i3status-rust
cp /etc/regolith/i3status-rust/config.toml ~/.config/regolith3/i3status-rust/config.toml- Configure to supply i3status-rust with your config file:
echo "wm.bar.status_config: ~/.config/regolith3/i3status-rust/config.toml" >> ~/.config/regolith3/Xresources- List all the battery instances running on your machine by running:
ls /sys/class/power_supply/
# AC BAT0 BAT1- In the staged config file, replace the
batteryblock (which shows the combined charge,device = "DisplayDevice") with one block per battery:
~/.config/regolith3/i3status-rust/config.toml
[[block]]
block = "battery"
interval = 10
device = "BAT0"
[[block]]
block = "battery"
interval = 10
device = "BAT1"- Refresh the session, or log back in:
regolith-look refreshSee the i3status-rust battery block documentation for further options.
Further Reading
See the reference page for configurations for more details about config files in Regolith.
Last updated on