Calculates cost of electricity.
Go to file
2024-05-19 21:57:38 +04:00
.gitignore kwh-calc renamed to more suitable name kwh-cost. 2021-12-24 23:54:31 +04:00
kwh-cost.c Version was set to 1.1.3. 2024-05-19 21:57:38 +04:00
LICENSE A version was set to 1.1.2. And a year 2023 was set to 2024. 2024-04-26 04:06:31 +04:00
Makefile Made a proper Makefile as it should be fixing many errors, like ignoring VAR overwriting. Also, wherever meaningful, = was replaced with := that evaluates once. Also made use of so-called "Order-only prerequisites" in an install target to build a program if it is not already built. Also removed a dangerous rm -rf with rm -f for a LICENSE file and rmdir for a directory. 2024-05-19 05:29:13 +04:00
PKGBUILD Version was set to 1.1.3. 2024-05-19 21:57:38 +04:00
README.md Updated a README.md. 2024-04-26 04:35:58 +04:00

kwh-cost

Calculates cost of electricity.

How to use

$ kwh-cost [OPTIONS] price wattage interval [interval ..]

Options are -v, --version to show program's version; and -h, --help to show usage of a program.

price is a price per kWh. wattage is how many Watts being consumed. interval is for how long.

interval is in seconds, but you can specify a unit. Units are the following: m|M for minutes; h|H for hours; and d|D for days. There could be as many intervals passed as you need.

Here is an example:

$ kwh-cost 4.02 120 30d 2h

Will give 348.29.

Installation

Manually

First run make to build a program, and then make install to copy executable in /usr/local/bin/. Later, use make uninstall to delete it, or just delete /usr/local/bin/kwh-cost.

A LICENSE file is also being copied to /usr/local/share/licenses/kwh-cost/LICENSE.

For ArchLinux

You can take a PKGBUILD file and in a directory with it run makepkg -i.