1 unstable release
0.1.0 | Aug 11, 2021 |
---|
#965 in Hardware support
24KB
161 lines
Kount

A global input counter with a built-in webserver for convenient use with streaming software.
Installation
Installing is fairly simple, provided you have a working Rust installation. If you don't have Rust installed, using Rustup to install it is highly recommended.
Compiling from source
To build for your default target, run
cargo build --release
Installing through crates.io
Installing is as simple as running
cargo install kount
Once run, Kount will be installed to your Cargo binary directory (unix: $HOME/.cargo/bin
, windows: %USERPROFILE%\.cargo\bin
) which should make kount
available in your path.
Binaries
If you don't have a working Rust installation and don't want to setup one, pre-compiled biaries are available from the releases tab.
Usage
Configuration
There are 4 environment variables the user can use to control and configure the program.
If you're not sure how to change these; don't worry. The defaults will likely work for you.
KOUNT_ADDR
(default:0.0.0.0
)
IP address the webserver should bind to.KOUNT_PORT
(default:3000
)
Port the webserver should listen on.KOUNT_DIR
(default:fields
)
Directory live counter files should be placed in.RUST_LOG
(default:kount=info
)
Tracing filter directive for console logs.
Throughout the remainder of this README, $WEB
is assumed to be and should be replaced with http://$KOUNT_ADDR:$KOUNT_PORT
.
By default, $WEB
is http://0.0.0.0:3000
and therefore the webserver runs at 0.0.0.0:3000.
Using with streaming software
Most streaming software has the ability to embed and live-reload text files. There are files corresponding to all fields, updating live. Reference available in the file API section.
If the streaming software you use isn't listed here, consider opening an issue or starting a topic in discussions about it. It's very likely that Kount can still work with the software.
API
There's a very rudementary web JSON "API" endpoint available: $WEB/json
returns all the counters as a JSON object.
Fields
Live-updating files with the values of fields.
The directory in which these files are placed can be configured, but are here assumed to be the default of fields
.
The counter directory is in the directory Kount was run from.
fields/keyboard
Keyboard press count
Fields
Endspoints available for directly accessing counters.
Prepend $WEB
to the endpoints listed below.
/field/keyboard
Keyboard press count
Dependencies
~13–51MB
~806K SLoC