Skip to content

Commit

Permalink
add -t 6, -t 7, and -t c[16 chars] for custom pipes
Browse files Browse the repository at this point in the history
  • Loading branch information
livibetter committed May 4, 2015
1 parent db80307 commit c7b220d
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Development
===========

* move to new GitHub_
* add ``-t c[16 chars]`` for custom type
* add ``-t 6`` and ``-t 7``

.. _GitHub: https://github.com/pipeseroni/pipes.sh

Expand Down
24 changes: 24 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,30 @@ Type of pipes, can be used more than once (D=0).
| | |
| | .. figure:: doc/pipes.t5.png |
+----------+-------------------------------+
| ``-t 6`` | ``.. .... .... ..`` |
| | |
| | .. figure:: doc/pipes.t6.png |
+----------+-------------------------------+
| ``-t 7`` | ``.o oo.o o.oo o.`` |
| | |
| | .. figure:: doc/pipes.t7.png |
+----------+-------------------------------+

``-t c[16 chars]``
------------------

Custom pipe, for example: ``-t cMAYFORCEBWITHYOU``.

.. note on taking the screenshot
Font is Inconsolata, font size 24 as in 16x35 pixel per character
Image size is 640x140. A sample command, where terminal at +0+18,
window border is 2, terminal is urxvt, seems to 2 pixels as padding:
xsnap -region 640x140+$((2+2))+$((20+2)) -file doc/pipes.tc.png
.. figure:: doc/pipes.tc.png

``-f [20-100]``
---------------
Expand Down
5 changes: 4 additions & 1 deletion doc/pipes.sh.6
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ A summary of options is included below. For a more complete description and exam
.B -p [1-]
Number of pipes. (default is 1)
.TP
.B -t [0-5]
.B -t [0-7]
Determines the type of pipes to be drawn. Multiple arguments can be used. (default is 0)
.TP
.B -t c[16 chars]
Use custom type of pipes.
.TP
.B -f [20-100]
Frame rate. (default is 75)
.TP
Expand Down
Binary file added doc/pipes.t6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/pipes.t7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/pipes.tc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion pipes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ sets=(
"║╔ ╗╝═╗ ╚║╝╚ ╔═"
"|+ ++-+ +|++ +-"
"|/ \/-\ \|/\ /-"
".. .... .... .."
".o oo.o o.oo o."
)
v=()
RNDSTART=0
Expand All @@ -32,7 +34,14 @@ OPTIND=1
while getopts "p:t:f:s:r:RBChv" arg; do
case $arg in
p) ((p=(OPTARG>0)?OPTARG:p));;
t) ((OPTARG>=0 && OPTARG<${#sets[@]})) && V+=($OPTARG);;
t)
if [[ "$OPTARG" = c???????????????? ]]; then
V+=(${#sets[@]})
sets+=("${OPTARG:1}")
else
((OPTARG>=0 && OPTARG<${#sets[@]})) && V+=($OPTARG)
fi
;;
f) ((f=(OPTARG>19 && OPTARG<101)?OPTARG:f));;
s) ((s=(OPTARG>4 && OPTARG<16 )?OPTARG:s));;
r) ((r=(OPTARG>=0)?OPTARG:r));;
Expand All @@ -43,6 +52,7 @@ case $arg in
echo -e "Animated pipes terminal screensaver.\n"
echo -e " -p [1-]\tnumber of pipes (D=1)."
echo -e " -t [0-$((${#sets[@]} - 1))]\ttype of pipes, can be used more than once (D=0)."
echo -e " -t c[16 chars]\tcustom type of pipes."
echo -e " -f [20-100]\tframerate (D=75)."
echo -e " -s [5-15]\tprobability of a straight fitting (D=13)."
echo -e " -r LIMIT\treset after x characters, 0 if no limit (D=2000)."
Expand Down

0 comments on commit c7b220d

Please sign in to comment.