▇▅▇▆▃▄▆▂▃▇▆▂▆▂▂▄▁▂▄▅▅▅▄▇▅▁▇▃▅▆▅▄▄▇▂▆▄
Displays sparklines on the terminal.
uspark
scans over all given arguments to detect the minimum and maximum
values. Afterwards, it maps each values to a glyph from a defined set to build
the sparkline. The terminal must support UTF-8 encoded characters.
uspark [OPTS --] <number-1> [<number-2> … ]
Options
-h - show help
-bars - use bars (default)
-lines - use lines
-braille - use braile characters
Use --
to separate options from arguments / numbers.
Environment Variables:
- USPARK_MIN: Use
USPARK_MIN
as the minimum value - USPARK_MAX: Use
USPARK_MAX
as the maximum value
Magnitude of earthquakes over 1.0 in the last 24 hours:
curl -L earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.csv --silent | \
sed '1d' | \
cut -d, -f5 |\
xargs ./uspark
▃▁▁▅▁█▆▃▃▅▂▁▂▂▂▁▇▂▆▅▁▂▃▇▅▁▇▅▁█▆▆▆▂▂▅▂
Random numbers
seq 0 40 | sort -R | xargs ./uspark
▁▆▂▂▃▄▇▁▁▂▅▃▂▁▇▆▅▃█▆▁▁▇▄▅▄▃▂▅▂▅▃▇▅▆▃▄▄▆▇▆
Cloud coverage for the next x hours, as forecasted by Pirateweather:
curl -L "https://api.pirateweather.net/forecast/$API_KEY/$LAT,$LONG?units=si" | \
jq '.hourly|.data[]|.cloudCover' | \
xargs ./uspark
▇▇██▅▃▂▂▂▁▂▂▂▃▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▅▄▁▁▁▁
The u
actually stands for µ
- so it is "mikro spark". It is a little nod
towards ustat.
I was interested in how large a self-contained binary written in Rust is in comparison to a statically linked binary written in C. Numbers:
Compiler | Build | Size of binary |
---|---|---|
diet-0.34 + gcc-12.2 | diet gcc -lstatic | 13288 |
rustc 1.84.0 (9fc6b4312 2025-01-07) | cargo build --release | 371096 |
GPL2, see COPYING
You need a C-compiler. Then:
$> cd c-lang
$> make
You need a Rust compiler. Then:
$> cd rust-lang
$> cargo build --release