kwh-cost/README.md

39 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

# kwh-cost
2021-12-23 18:49:41 +04:00
Calculates cost of electricity.
2021-12-24 00:47:55 +04:00
## How to use
2022-01-03 02:20:17 +04:00
```console
$ kwh-cost [OPTIONS] price wattage interval [interval ..]
2021-12-24 00:47:55 +04:00
```
2021-12-25 00:08:45 +04:00
Options are `-v, --version` to show program's version; and `-h, --help` to show usage of a program.
2021-12-24 00:47:55 +04:00
`price` is a price per kWh. `wattage` is how many Watts being consumed. `interval` is for how long.
2021-12-24 00:47:55 +04:00
`interval` is in seconds, but you can specify a unit. Units are the following:
2024-04-26 04:35:58 +04:00
`m|M` for minutes; `h|H` for hours; and `d|D` for days. There could be as many `interval`s passed as you need.
2021-12-24 00:47:55 +04:00
Here is an example:
2022-01-03 02:20:17 +04:00
```console
$ kwh-cost 4.02 120 30d 2h
2021-12-24 00:47:55 +04:00
```
Will give 348.29.
2021-12-24 00:47:55 +04:00
## Installation
### Manually
2024-05-19 23:15:16 +04:00
Just run `make install` to build and copy executable in `/usr/local/bin/`, set a `PREFIX=` variable to change a default `/usr/local` path. Or just run `make` to only build an executable.
2024-04-26 04:35:58 +04:00
2024-05-19 23:15:16 +04:00
Use `make uninstall` to delete it (don't forget about the `PREFIX=` variable if you previously set it), or just delete `${PREFIX}/bin/kwh-cost` by hand.
A `LICENSE` file is also being copied to `${PREFIX}/share/licenses/kwh-cost/LICENSE`.
2021-12-24 00:47:55 +04:00
### For ArchLinux
You can take a [PKGBUILD](/Arav/kwh-cost/raw/branch/master/PKGBUILD) file and in a directory with it run `makepkg -i`.