Skip to content

Instantly share code, notes, and snippets.

@fritschy
Created October 25, 2016 21:41
Show Gist options
  • Select an option

  • Save fritschy/f6fddf109f1df8dbc0639aafa9a5328e to your computer and use it in GitHub Desktop.

Select an option

Save fritschy/f6fddf109f1df8dbc0639aafa9a5328e to your computer and use it in GitHub Desktop.
#!/bin/sh
c=$1
max=$2
title=""
set -eu
[ "$c" = "" ] && exit 1
[ "$max" = "" ] && max=100 || { shift 2; title="$@ "; }
[ $c -lt 1 ] && c=1
[ $c -gt $max ] && c=$max
bar() {
echo -n "$title"
for i in $(seq 1 $c)
do
echo -n "|"
done
for i in $(seq $(expr $c + 1) $max)
do
echo -n "-"
done
echo " ($(printf '%3d' $c)%)"
}
bar | aosd_cat \
--fade-in=0 \
--fade-full=200 \
--fade-out=0 \
--back-opacity=255 \
--back-color=grey40 \
--fore-color='#00ff00' \
--position=4 \
--font="Consolas 24" &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment