-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b0a1fc
commit be07421
Showing
2 changed files
with
75 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# rusty-battery | ||
|
||
[![crates.io](https://img.shields.io/crates/v/rusty-battery?logo=rust)](https://crates.io/crates/rusty-battery) | ||
[![Test Suite](https://github.com/kucera-lukas/rusty-battery/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/kucera-lukas/rusty-battery/actions/workflows/test.yml) | ||
[![codecov](https://codecov.io/gh/kucera-lukas/rusty-battery/branch/main/graph/badge.svg?token=1MM2CUE75Q)](https://codecov.io/gh/kucera-lukas/rusty-battery) | ||
[![pages-build-deployment](https://github.com/kucera-lukas/rusty-battery/actions/workflows/pages/pages-build-deployment/badge.svg)](https://rustybattery.lukaskucera.com) | ||
[![Continuous Integration](https://github.com/kucera-lukas/rusty-battery/actions/workflows/ci.yml/badge.svg)](https://github.com/kucera-lukas/rusty-battery/actions/workflows/ci.yml) | ||
|
||
CLI tool to help you care about your devices's battery health. | ||
CLI tool which notifies you when laptop battery reaches a threshold. | ||
|
||
# Why should you use `rusty-battery`? | ||
|
||
|
@@ -88,21 +88,40 @@ FLAGS: | |
|
||
## From [crates.io](https://crates.io/crates/rusty-battery) | ||
|
||
`cargo install rust-battery` | ||
```sh | ||
cargo install rusty-battery | ||
``` | ||
|
||
## From [source](https://github.com/kucera-lukas/rusty-battery) | ||
|
||
1. `git clone [email protected]:kucera-lukas/rusty-battery.git` | ||
2. `cd rusty-battery` | ||
3. `cargo install --path .` | ||
1. Clone the repository | ||
|
||
```sh | ||
git clone [email protected]:kucera-lukas/rusty-battery.git | ||
``` | ||
|
||
2. Change directory | ||
|
||
```sh | ||
cd rusty-battery | ||
``` | ||
|
||
3. Install with cargo | ||
|
||
```sh | ||
cargo install --path . | ||
``` | ||
|
||
## From [release page](https://github.com/kucera-lukas/rusty-battery/releases) | ||
|
||
Download a binary of the | ||
[latest release](https://github.com/kucera-lukas/rusty-battery/releases/latest) | ||
and move it to a directory which is in your `$PATH`. | ||
You may need to change the binary's permissions by running | ||
`chmod +x rusty-battery`. | ||
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. | ||
|
||
|
@@ -112,28 +131,57 @@ This tool is best used when set up as a background task. | |
|
||
### Setup with `cron` | ||
|
||
1. open terminal | ||
2. `crontab -e` - this should open a text editor | ||
3. paste in `@reboot rusty-battery notify [YOUR OPTIONS]` | ||
4. save and exit the text editor, you should see `crontab: installing new crontab` in your terminal | ||
5. `reboot` | ||
1. Open crontab | ||
|
||
```sh | ||
crontab -e | ||
``` | ||
|
||
2. Paste in `@reboot rusty-battery notify [YOUR OPTIONS]` | ||
3. Save and exit the text editor, you should see `crontab: installing new crontab` in your terminal | ||
4. Reboot the system | ||
|
||
```sh | ||
reboot | ||
``` | ||
|
||
### Logging | ||
|
||
1. choose the log verbosity via the `-v` or `--verbose` flag | ||
2. append it to the `rusty-battery` command | ||
3. redirect output via `>> /path/to/log/file 2>&1` | ||
4. check all logs via `more /path/to/log/file` | ||
1. Choose the log verbosity via the `-v` or `--verbose` flag | ||
2. Append it to the `rusty-battery` command | ||
3. Redirect output via `>> /path/to/log/file 2>&1` | ||
4. Check all logs via | ||
|
||
```sh | ||
more /path/to/log/file | ||
``` | ||
|
||
- Check live logs: | ||
|
||
```sh | ||
tail -f /path/to/log/file | ||
``` | ||
|
||
- for live logs use `tail`: `tail -f /path/to/log/file` | ||
- `2>&1` [explanation](https://stackoverflow.com/questions/818255/in-the-shell-what-does-21-mean) | ||
|
||
### Debugging | ||
|
||
- [here is a useful thread](https://askubuntu.com/questions/23009/why-crontab-scripts-are-not-working) for crontab debugging | ||
- to check that `rusty-battery` is running you can use `ps aux | grep -e rusty-battery` | ||
- to kill the job you can use `kill $PID` (`$PID` can be found via the previous command) | ||
- [Here is a useful thread](https://askubuntu.com/questions/23009/why-crontab-scripts-are-not-working) for crontab debugging | ||
- To check that `rusty-battery` is running you can use | ||
|
||
```sh | ||
ps aux | grep -e rusty-battery | ||
``` | ||
|
||
- To kill the job you can use (`$PID` can be found via the previous command): | ||
|
||
```sh | ||
kill $PID | ||
``` | ||
|
||
# Device support | ||
|
||
# OS support | ||
Tested on: | ||
|
||
Currently, only linux is supported. | ||
- OS: Fedora 34, 35, 36 | ||
- DE: Plasma |