Skip to content

Run set of tasks and be notified via LED light - blink(1)

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

devzbysiu/cargo-blinc

cargo-blinc

Instant feedback on the state of your tests*

CI status badge Crates.io version Code coverage License

Built with 🦀

About

This crate allows running arbitrary commands and indicate the status of its execution using USB notification light - blink(1).

*By default it runs cargo test. You can customize the commands and LED colors using configuration file.

Example use case:
  • run cargo watch -x blinc
  • after every file save, it will start blinking with blue light
  • it will start execution of cargo test
  • after tests finish it will glow red when tests fail or green when tests succeed

Demo

Demo GIF

Installation

To install

cargo install cargo-blinc

To upgrade

cargo install --force cargo-blinc

Make sure that you have correct access rights to access blink(1) device. See udev rules here.

Configuration

By default, no configuration is required if these settings satisfy you:

  • tasks: cargo check, cargo test
  • pending task color: blue (blinking)
  • failed task color: red
  • successful task color: green

You can control all of these by configuration file.

Run cargo blinc --init <path> to initialize config. It will create file, under specified path, with following content:

[[tasks]]
cmd = "cargo"
args = ["check"]

[[tasks]]
cmd = "cargo"
args = ["test"]

[colors]
pending = ["blue", "white"]
failure = "red"
success = "green"

[env]

Run cargo blinc --config <path> to specify path to the configuration file. The default value is .blinc.

The [env] section is empty by default. It allows specifying environment variables during execution of configured [[tasks]]. Example:

[[tasks]]
cmd = "cargo"
args = ["check"]

[[tasks]]
cmd = "cargo"
args = ["test"]

[colors]
pending = ["blue", "white"]
failure = "red"
success = "green"

[env]
RUST_LOG = "debug"
API_KEY = "1231431"

If you don't have a need to specify environment variables, you can remove the section.

License

This project is licensed under either of

At your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Run set of tasks and be notified via LED light - blink(1)

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages