Skip to content

nicoestrada/batty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Set laptop battery thresholds on Linux

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages