بنقرة واحدة
seg-lcd-rust
Render seven-segment LCD text in terminal, SVG, or PNG using the seg-lcd-rust CLI.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Render seven-segment LCD text in terminal, SVG, or PNG using the seg-lcd-rust CLI.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | seg-lcd-rust |
| description | Render seven-segment LCD text in terminal, SVG, or PNG using the seg-lcd-rust CLI. |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| metadata | {"hermes":{"tags":["seven-segment","lcd","svg","terminal","cli","rust"]}} |
Use this skill when the user asks to render seven-segment/LCD-style digits or text, generate SVG previews, test the seg-lcd-rust CLI, or work on the forjd/seg-lcd-rust repository.
The release installer installs binaries to ~/.local/bin:
seg-lcd-rust — terminal renderer, SVG exporter, and native PNG exporterseg-lcd-rust-gui — native egui desktop GUI; requires a graphical display (DISPLAY, Wayland, etc.)Install/update from GitHub Releases:
curl -fsSL https://raw.githubusercontent.com/Forjd/seg-lcd-rust/main/install.sh | sh
Install to a custom directory:
curl -fsSL https://raw.githubusercontent.com/Forjd/seg-lcd-rust/main/install.sh | sh -s -- --dir ~/.local/bin
Install a specific version:
curl -fsSL https://raw.githubusercontent.com/Forjd/seg-lcd-rust/main/install.sh | sh -s -- --version v0.6.0
Basic terminal render:
seg-lcd-rust '10:58.42'
Labels mode:
seg-lcd-rust --labels HELP
Print segment masks:
seg-lcd-rust '12:34.5' --masks
Custom segment masks:
seg-lcd-rust --mask ABDEG --mask BCG --labels
Inverse terminal render:
seg-lcd-rust --inverse '10:58.42'
SVG export:
seg-lcd-rust --svg display.svg --theme amber '10:58.42'
seg-lcd-rust --svg blue.svg --theme blue --glow '88:88.88'
seg-lcd-rust --svg custom.svg --on 102418 --off 6b7a62 --bg dbe5d2 --panel c3d0ba --inactive-opacity 0.18 1234
PNG export:
seg-lcd-rust --png blue.png --theme blue --glow '88:88.88'
seg-lcd-rust --png amber.png --theme amber '12:34.5'
seg-lcd-rust --png custom.png --on b86cff --off 2b1748 --bg 08030f --panel 160820 --glow '42.0'
Native PNG output rasterizes the existing SVG renderer, so SVG and PNG output should stay visually consistent.
Available themes observed in help: classic, green, amber, blue, negative.
Use native --png PATH when working from this branch or any release that includes PNG export:
png="$HOME/.hermes/tmp/seg-lcd-example.png"
mkdir -p "$(dirname "$png")"
seg-lcd-rust --png "$png" --theme blue --glow '12:34.5'
file "$png"
For older releases such as v0.6.0 that lack --png, first generate SVG, then rasterize it with scripts/svg-to-png.sh INPUT.svg OUTPUT.png or a headless browser. The helper currently accepts exactly two arguments; do not pass a size like 1200x400 unless the script has been updated.
command -v seg-lcd-rust
seg-lcd-rust --help
seg-lcd-rust '10:58.42'
out=$(mktemp --suffix=.svg)
seg-lcd-rust --svg "$out" --theme amber '10:58.42'
test -s "$out"
png=$(mktemp --suffix=.png)
seg-lcd-rust --png "$png" --theme blue --glow '10:58.42'
file "$png" | grep 'PNG image data'
seg-lcd-rust --version is not supported in v0.6.0; it exits 2 with unknown option: --version.--help text currently says Usage: cargo run -- [OPTIONS] [TEXT] even for the installed binary; use seg-lcd-rust [OPTIONS] [TEXT] when explaining installed usage.wrote PATH to stdout.seg-lcd-rust-gui cannot run in headless environments without DISPLAY, WAYLAND_DISPLAY, or WAYLAND_SOCKET.scripts/svg-to-png.sh converts generated SVGs to PNG using rsvg-convert, ImageMagick, Google Chrome, or Chromium, whichever is available.Session reference: references/png-export-pr-notes.md captures the completed local PNG export implementation, verification commands/results, and GitHub PR/auth state from the original work session.
Repository: https://github.com/forjd/seg-lcd-rust
If adding or revisiting native PNG support, prefer reusing the SVG rendering pipeline rather than duplicating geometry/rasterization:
resvg, usvg, and tiny-skia.render_png(text, style) -> Result<Vec<u8>, String>render_cells_png(cells, style) -> Result<Vec<u8>, String>render_svg_to_png(svg) -> Result<Vec<u8>, String>render_svg_to_png with:
usvg::Tree::from_str(svg, &usvg::Options::default())tree.size().to_int_size()tiny_skia::Pixmap::new(width, height)resvg::render(&tree, tiny_skia::Transform::identity(), &mut pixmap.as_mut())pixmap.encode_png()--png PATH parsing in src/main.rs, write bytes with fs::write, and print wrote PATH matching SVG behavior.tests/ using env!("CARGO_BIN_EXE_seg-lcd-rust"); assert the output starts with the PNG signature \x89PNG\r\n\x1a\n and that missing --png path reports --png requires an output path.If GitHub auth is absent, commit locally and export git format-patch origin/main..HEAD --stdout so the user can apply/push the work.
If editing the repo, follow AGENTS.md:
src/main.rssrc/bin/gui.rssrc/lib.rssrc/lib.rs so CLI and GUI stay consistent.cargo run -- ... for local CLI development; Cargo.toml sets default-run = "seg-lcd-rust".main.Verification from AGENTS.md expects rtk in that environment:
rtk cargo fmt --check
rtk cargo test
rtk cargo clippy --all-targets -- -D warnings
For GUI changes also run:
rtk cargo check --bin seg-lcd-rust-gui
If rtk or cargo is not installed in the current environment, report that clearly rather than guessing test results.