CLI tool which notifies you when laptop battery reaches a threshold.
rusty-battery
?If you aren't able to set start/stop charge threshold
(for example via TLP) but would still like to
make sure that your battery won't exceed your preferred threshold.
rusty-battery
can let you know when your battery reached the threshold by
showing a desktop notification and optionally pinging your
KDE Connect devices.
Notify whenever battery percentage exceeds the given threshold
USAGE:
rusty-battery notify [OPTIONS]
OPTIONS:
--disable-desktop
Disable desktop notifications
Specify this flag if you don't want desktop notifications to be shown whenever the
chosen battery percentage exceeds the given threshold.
-h, --help
Print help information
--kde-connect [<KDE_CONNECT_NAMES>...]
KDE Connect device names
If this value is not present, KDE Connect will not be used.
If this value is empty, all of the KDE Connect devices will be pinged.
-m, --model <MODEL>
Battery model name
If this value is omitted and only battery device is found for the current device, that
one will be used.
Otherwise, please use the `batteries` subcommand to get a list of all battery devices to
get the model of the wanted battery device which should be monitored.
-q, --quiet
Less output per occurrence
--refresh-secs <REFRESH_SECS>
Number of seconds to wait before refreshing battery device data
After every battery device refresh, its data will be checked. Notifications will be sent
everytime they should be, based on the new refreshed battery device data.
[default: 30]
-t, --threshold <THRESHOLD>
Battery charge threshold
Whenever the chosen battery device reaches this charge threshold and will be charging,
notifications will be sent, alerting that the charger should be unplugged.
[default: 80]
-v, --verbose
More output per occurrence
-V, --version
Print version information
List all available batteries of the current device
USAGE:
rusty-battery batteries [OPTIONS]
OPTIONS:
-h, --help Print help information
-q, --quiet Less output per occurrence
-v, --verbose More output per occurrence
-V, --version Print version information
List all available KDE Connect devices
USAGE:
rusty-battery kde-connect-devices [OPTIONS]
OPTIONS:
-h, --help Print help information
-q, --quiet Less output per occurrence
-v, --verbose More output per occurrence
-V, --version Print version information
sh
cargo install rusty-battery
sh
git clone git@github.com:kucera-lukas/rusty-battery.git
sh
cd rusty-battery
sh
cargo install --path .
Download a binary of the
latest release
and move it to a directory which is in your $PATH
.
You may need to change the binary's permissions by running:
sh
chmod +x rusty-battery
If there are any problems with the pre-compiled binaries, file an issue.
This tool is best used when set up as a background task.
cron
sh
crontab -e
@reboot rusty-battery notify [YOUR OPTIONS]
crontab: installing new crontab
in your terminalsh
reboot
-v
or --verbose
flagrusty-battery
command>> /path/to/log/file 2>&1
sh
more /path/to/log/file
sh
tail -f /path/to/log/file
2>&1
explanationrusty-battery
is running you can usesh
ps aux | grep -e rusty-battery
$PID
can be found via the previous command):sh
kill $PID
Tested on: