- 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
cargo install battyAfter 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 ~/.zshrcbattyTo run batty, it requires root privileges:
View current battery charge thresholds:
sudo ~/.cargo/bin/battySet the end threshold (default kind):
sudo ~/.cargo/bin/batty --value 80Set the start threshold:
sudo ~/.cargo/bin/batty --value 40 --kind startOr use the short flags:
sudo ~/.cargo/bin/batty -v 40 -k startWorks immediately. Keep in mind it is not persistent yet.
sudo ~/.cargo/bin/batty --tuiThis 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