Calculates cost of electricity.
Go to file
Alexander "Arav" Andreev b457c60f75
[main.c] Structure arguments_t removed. Use ptrs to vars instead. parse_arguments now returns status codes instead of printing stuff and closing program.
`to_wattpersecond` is now `to_wattspersecond`.
Fixed typo in usage, capitalised `options` word. Rephrased `print_version` text.
Removed unnecessary check from `interval_to_seconds` (former `to_seconds`) function.
2021-12-25 23:27:53 +04:00
src [main.c] Structure arguments_t removed. Use ptrs to vars instead. parse_arguments now returns status codes instead of printing stuff and closing program. 2021-12-25 23:27:53 +04:00
.gitignore kwh-calc renamed to more suitable name kwh-cost. 2021-12-24 23:54:31 +04:00
LICENSE +NIGGER is not needed here. 2021-12-24 01:39:23 +04:00
Makefile [Makefile] Added .PHONY. Removed object compilation. This project won't get extra .c files anyway, so let's compile directly into executable. 2021-12-25 23:22:32 +04:00
PKGBUILD kwh-calc renamed to more suitable name kwh-cost. 2021-12-24 23:54:31 +04:00
README.md Updated README. 2021-12-25 00:08:45 +04:00

kwh-cost

Calculate 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 for minutes; h for hours; and d for days. There could be as many intervals passed as you need.

Here is an example:

$ kwh-cost 3.68 120 30d 2h

P.S.: Yeah, I pay 3.68 rubles per kWh. Which is just $0.05. :)

Installation

Manually

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.

For ArchLinux

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