From be07421dea49a422621ea461411f7fbd22fbaf40 Mon Sep 17 00:00:00 2001 From: Lukas Kucera <85391931+kucera-lukas@users.noreply.github.com> Date: Sun, 25 Sep 2022 17:37:39 +0200 Subject: [PATCH] feat: update docs (#120) --- Cargo.toml | 6 ++-- README.md | 96 ++++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 75 insertions(+), 27 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8fc17a4..be9d6ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] diff --git a/README.md b/README.md index e607005..55d4c5d 100644 --- a/README.md +++ b/README.md @@ -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 git@github.com:kucera-lukas/rusty-battery.git` -2. `cd rusty-battery` -3. `cargo install --path .` +1. Clone the repository + +```sh +git clone git@github.com: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