Skip to content

Commit

Permalink
feat: update docs (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
kucera-lukas authored Sep 25, 2022
1 parent 0b0a1fc commit be07421
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 27 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
name = "rusty-battery"
version = "0.2.1"
edition = "2021"
description = "CLI tool to help you care about your device's battery health."
documentation = "https://kucera-lukas.github.io/rusty-battery/"
description = "CLI tool which notifies you when laptop battery reaches a threshold."
documentation = "https://rustybattery.lukaskucera.com"
readme = "README.md"
homepage = "https://kucera-lukas.github.io/rusty-battery/"
homepage = "https://rustybattery.lukaskucera.com"
repository = "https://github.com/kucera-lukas/rusty-battery"
license = "MIT"
keywords = ["cli", "battery", "notification", "kdeconnect", "linux"]
Expand Down
96 changes: 72 additions & 24 deletions README.md
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`?

Expand Down Expand Up @@ -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.

Expand All @@ -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

0 comments on commit be07421

Please sign in to comment.