2021-12-24 23:54:31 +04:00
# kwh-cost
2021-12-23 18:49:41 +04:00
2022-04-10 18:45:54 +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
2021-12-24 23:54:31 +04:00
$ 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
2021-12-24 01:25:33 +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:
`m` for minutes; `h` for hours; and `d` for days. There could be as many `interval` s passed as you need.
Here is an example:
2022-01-03 02:20:17 +04:00
```console
2022-10-06 22:09:17 +04:00
$ kwh-cost 4.02 120 30d 2h
2021-12-24 00:47:55 +04:00
```
2022-10-06 22:09:17 +04:00
Will give 348.29.
2022-04-10 18:45:54 +04:00
2021-12-24 00:47:55 +04:00
## Installation
### Manually
2021-12-24 23:54:31 +04:00
First run `make` to build a program, and then `make install` to copy executable in `/usr/bin/` . Later, use `make uninstall` to delete it, or just delete `/usr/bin/kwh-cost` .
2021-12-24 00:47:55 +04:00
### For ArchLinux
2022-04-10 21:08:19 +04:00
You can take a [PKGBUILD ](/Arav/kwh-cost/raw/branch/master/PKGBUILD ) file and in a directory with it run `makepkg -i` .
If you want to use a pre-built package for Arch from Releases, then install it using `pacman -U` command.