Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

hi-res sparklines for your shell

License

NotificationsYou must be signed in to change notification settings

muhqu/superspark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Inspired byZach Holman'sspark, it brings sparklines, with greater detail, to your shell.

See the demo:

install

superspark is ashell script that wraps arround a tinyphp command line script. For it to run you need php 5.3 (or above) and need to place the script somewhere on your$PATH.

wget https://raw.github.com/muhqu/superspark/master/superspark \  -O /usr/local/bin/supersparkchmod +x /usr/local/bin/supersparksuperspark -h

basic usage

Read values via script arguments.

$ superspark 1 2 3 5 8 15 26  ̄̄ ̄̄̄ ̄̄̄̄ ̄̄̄̄̄ ̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄

Read values fromstdin. One value per line.

$ seq 0 18| superspark  ̄ ̄̄ ̄̄̄ ̄̄̄̄ ̄̄̄̄̄ ̄̄̄̄̄̄ ̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄

advanced usage

Repeatedly execCMD to read values. One value per line. SleepN seconds between redraws.

$ superspark -n 1 -c"seq 0 40 | awk '{    printf\"%6d\\n\", (sin((systime()+\$1)/2)*cos((systime()+\$1)/4)+1)*20;  }'"  ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄ ̄̄̄̄ ̄̄̄̄ ̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄ ̄̄̄̄̄ ̄̄̄̄ ̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄ ̄̄̄̄ ̄̄̄̄ ̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄ ̄̄̄̄ ̄̄̄̄̄ ̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄

Continuously read fromstdin and draw an accumulated graph with every new value. One value per line.

$ ping -n localhost| awk'BEGIN{FS="time=|ms"}{    printf "%d\n", $2*1000;fflush();}'| superspark -s -L  ̄ ̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ ̄̄̄̄̄̄̄̄̄̄̄̄̄̄̄ min: 0      max: 126    curr: 93     mean: 98.79

how does it work?

The sparklines are assembled using the unicodecombining characterU+0304 which is namedCOMBINING MACRON. ...like an apostrophe dash. So, this obviously only works on full-fledged UTF-8 enabled terminals... e.g.iTerm 2, Terminal.app on Mac. Don't know about windows/linux support yet...

who?

© 2013 by Mathias Leppich
github.com/muhqu,@muhqu

About

hi-res sparklines for your shell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp