6 releases (3 breaking)

0.4.2 Nov 6, 2025
0.4.1 Oct 30, 2025
0.3.0 Oct 17, 2025
0.2.0 Oct 10, 2025
0.1.0 Sep 26, 2025

#976 in Filesystem

MIT license

105KB
759 lines

Batty - Battery Health TUI for Linux

What this is for

  • Batty is meant to be installed and used in tandem with power-profiles-daemon
  • Do not use this with TLP as it can cause unpredictable behavior. Usually TLP can solve this however for projects like Omarchy where TLP is not provided, Batty can work in substitute, which inspired me to build this simple tool.
  • Can use the TUI to alter battery threshold

Batty TUI Screenshot

How to use it

Install Batty

cargo install batty

After installation, batty is placed in ~/.cargo/bin. To run it directly, ensure ~/.cargo/bin is in your $PATH. Add it to your shell configuration (e.g., ~/.bashrc or ~/.zshrc):

export PATH="$HOME/.cargo/bin:$PATH"

Then reload your shell:

source ~/.bashrc  # or ~/.zshrc

If ~/.cargo/bin is in your $PATH, you can just run:

batty

To run batty, it requires root privileges:

Option A - Use CLI

View current battery charge thresholds:

sudo ~/.cargo/bin/batty

Set the end threshold (default kind):

sudo ~/.cargo/bin/batty --value 80

Set the start threshold:

sudo ~/.cargo/bin/batty --value 40 --kind start

Or use the short flags:

sudo ~/.cargo/bin/batty -v 40 -k start

Works immediately. Keep in mind it is not persistent yet.


Option B - Use TUI

sudo ~/.cargo/bin/batty --tui

This will give you write access in the TUI.

Controls:

  • Use ↑/↓ or +/- to adjust thresholds
  • Use j/k to switch between start and end threshold
  • Press Enter to save both thresholds
  • Press q to quit

Dependencies

~7MB
~110K SLoC