Skip to content

Commit

Permalink
add -t 2, -t 3, -t 4, 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 3033e88 commit 23fba7a
Show file tree
Hide file tree
Showing 7 changed files with 38 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[2 chars]`` for custom type
* add ``-t 2``, ``-t 3``, and ``-t 4``

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

Expand Down
28 changes: 28 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,34 @@ Types of pipes, can be used more than once (Default: 0).
| | |
| | .. figure:: doc/pipesX.t1.png |
+----------+-------------------------------+
| ``-t 2`` | ``..`` |
| | |
| | .. figure:: doc/pipesX.t2.png |
+----------+-------------------------------+
| ``-t 3`` | ``oo`` |
| | |
| | .. figure:: doc/pipesX.t3.png |
+----------+-------------------------------+
| ``-t 4`` | ``\/`` |
| | |
| | .. figure:: doc/pipesX.t4.png |
+----------+-------------------------------+

``-t c[2 chars]``
-----------------

Custom pipe, for example: ``-t cR2 -t cD2``.

.. 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/pipesX.tc.png
.. figure:: doc/pipesX.tc.png

``-i [float]``
--------------
Expand Down
Binary file added doc/pipesX.t2.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/pipesX.t3.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/pipesX.t4.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/pipesX.tc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions pipesX.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ W=$(tput cols) H=$(tput lines)
# maximal random value + 1
M=32768

SETS=('╱╲' '/\')
SETS=('╱╲' '/\' '..' 'oo' '\/')
COLORS=(31 32 33 34 35 36 37)

# default values
Expand All @@ -45,6 +45,7 @@ Options:
-n [1-] number of pipes. (Default: $N)
-t [0-$((${#SETS[@]} - 1))] types of pipes, can be used more than once. (Default: $T)
-t c[2chs] custom type of pipes.
-i [float] piping interval or maze generation interval. (Default: $I)
-P [0-100] probability of a turning pipe or of \\ in maze generation. (Default: $P)
-r [LIMIT] reset after x characters, 0 if no limit. (Default: $R)
Expand All @@ -61,7 +62,12 @@ while getopts "n:t:i:P:r:RCXhv" arg; do
((N = OPTARG > 0 ? OPTARG : N))
;;
t)
T+=($(((OPTARG >= 0 && OPTARG < ${#SETS[@]}) ? OPTARG : T)))
if [[ "$OPTARG" = c?? ]]; then
T+=(${#SETS[@]})
SETS+=("${OPTARG:1}")
else
T+=($(((OPTARG >= 0 && OPTARG < ${#SETS[@]}) ? OPTARG : T)))
fi
;;
i)
I=$OPTARG
Expand Down

0 comments on commit 23fba7a

Please sign in to comment.