No description
Find a file
dependabot[bot] 1260ea4c92
Bump the minor-updates group across 1 directory with 5 updates
Bumps the minor-updates group with 5 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.8` | `4.5.9` |
| [serde](https://github.com/serde-rs/serde) | `1.0.203` | `1.0.204` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.118` | `1.0.120` |
| [toml](https://github.com/toml-rs/toml) | `0.8.14` | `0.8.15` |
| [zerocopy](https://github.com/google/zerocopy) | `0.7.34` | `0.7.35` |



Updates `clap` from 4.5.8 to 4.5.9
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.8...v4.5.9)

Updates `serde` from 1.0.203 to 1.0.204
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

Updates `serde_json` from 1.0.118 to 1.0.120
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.118...v1.0.120)

Updates `toml` from 0.8.14 to 0.8.15
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.14...toml-v0.8.15)

Updates `zerocopy` from 0.7.34 to 0.7.35
- [Release notes](https://github.com/google/zerocopy/releases)
- [Changelog](https://github.com/google/zerocopy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/zerocopy/commits)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-updates
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-updates
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-updates
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-updates
- dependency-name: zerocopy
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-17 17:17:03 +00:00
.github Enable dependabot 2024-06-08 13:55:27 +02:00
demo Initial commit 2024-06-07 13:33:27 +00:00
examples Initial commit 2024-06-07 13:33:27 +00:00
src Allow usage without embedded graphics 2024-06-07 20:04:53 +00:00
.gitignore Initial commit 2024-06-07 13:33:27 +00:00
build.rs Initial commit 2024-06-07 13:33:27 +00:00
Cargo.lock Bump the minor-updates group across 1 directory with 5 updates 2024-07-17 17:17:03 +00:00
Cargo.toml Bump the minor-updates group across 1 directory with 5 updates 2024-07-17 17:17:03 +00:00
LICENSE-APACHE Initial commit 2024-06-07 13:33:27 +00:00
LICENSE-MIT Initial commit 2024-06-07 13:33:27 +00:00
README.md Initial commit 2024-06-07 13:33:27 +00:00
rustfmt.toml Initial commit 2024-06-07 13:33:27 +00:00

CI

Badge Magic in Rust

Library and CLI to configure LED badges.

Installation

As of now there are no proper releases (with version numbers) of this tool.

The latest commit on the main branch just gets build and released automatically.

Download the prebuild program for one of the following operating systems:

# After the download rename the file to `badgemagic`
mv badgemagic.<target> badgemagic

# Make the program executable (linux / macOS only)
chmod +x badgemagic

# Test that it works
./badgemagic --help

Note: The windows and macOS build is not actively tested. Please try it out and report back whether it worked or any problems that might occour.

If your system is not listed above (Linux / Windows on ARM, musl, etc.) or you want to do it anyway, you can install this tool from source:

cargo install --git https://github.com/fossasia/badgemagic-rs --features cli
badgemagic --help

Or clone the repo and run the CLI:

git clone https://github.com/fossasia/badgemagic-rs
cd badgemagic-rs
cargo run --features cli -- --help

Usage

Execute the badgemagic tool and pass the file name of your configuration file. Depending on how you installed the tool:

# Downloaded from release page
./badgemagic config.toml

# Installed with cargo install
badgemagic config.toml

# Run from git repository
cargo run --features cli -- config.toml

The above command will read your configuration from a file named config.toml in the current directory.

Configuration

You can have a look at the example configurations in the demo directory.

The TOML configuration consists of up to 8 message sections starting with [[message]].

Each message can have the following options:

[[message]]
# Enable blink mode
blink = true

# Show a dotted border arround the display
border = true

# Set the update speed of the animations (0 to 7)
speed = 6

# Set the display animation (left, right, up, down, center, fast, drop, curtain, laser)
mode = "left"

# The text to show on the display
text = "Lorem ipsum dolor sit amet."

You can omit options you don't need:

[[message]]
mode = "center"
text = "Hello"

If you want you can "draw" images as ASCII art (_ = Off, X = On):

[[message]]
mode = "center"
bitstring = """
___XXXXX___
__X_____X__
_X_______X_
X__XX_XX__X
X__XX_XX__X
X_________X
X_XX___XX_X
X__XXXXX__X
_X__XXX__X_
__X_____X__
___XXXXX___
"""

You just replace the text option with bitstring. All other options (e.g. border, blink) still work and can be combined with a custom image.

License

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.