diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-08-18 19:55:00 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-08-18 19:55:00 +0200 |
commit | fec01d46460d7a117edba91856ae467a7754402d (patch) | |
tree | fc3a9bb5a47ae32cb91fc11306943a913e1ac5d5 /ponysay.sh | |
parent | d7bebf30ecbd74c1a9bd764853464f831dd81273 (diff) | |
download | ponysay-fec01d46460d7a117edba91856ae467a7754402d.tar.gz ponysay-fec01d46460d7a117edba91856ae467a7754402d.tar.bz2 ponysay-fec01d46460d7a117edba91856ae467a7754402d.zip |
height trunction
Diffstat (limited to 'ponysay.sh')
-rwxr-xr-x | ponysay.sh | 26 |
1 files changed, 0 insertions, 26 deletions
@@ -1,9 +1,6 @@ #!/usr/bin/env bash -scrw=`(stty size <&2 || echo 0 0) | cut -d ' ' -f 2` # Screen width -scrh=`(stty size <&2 || echo 0 0) | cut -d ' ' -f 1` # Screen height - # KMS ponies extension kmscmd="" [ "$TERM" = "linux" ] && kmscmd=$(for c in $(echo $PATH":" | sed -e 's/:/\/ponysay2kmsponysay /g'); do if [ -f $c ]; then echo $c; break; fi done) @@ -12,19 +9,6 @@ kmscmd="" # Function for printing the ponies and the message say() { - # Set PONYSAY_SHELL_LINES to default if not specified - [ "$PONYSAY_SHELL_LINES" = "" ] && PONYSAY_SHELL_LINES=2 - - # Height trunction, show top - function htrunchead { - head --lines=$(( $scrh - $PONYSAY_SHELL_LINES )) - } - - # Height trunction, show bottom - function htrunctail { - tail --lines=$(( $scrh - $PONYSAY_SHELL_LINES )) - } - # KMS ponies support if [ "$kmscmd" = "" ]; then function runcmd { @@ -36,14 +20,4 @@ say() { } fi - # Print the pony and the message - if [ "$TERM" = "linux" ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'yes' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'y' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = '1' ]; then - if [ "$PONYSAY_BOTTOM" = 'yes' ] || [ "$PONYSAY_BOTTOM" = 'y' ] || [ "$PONYSAY_BOTTOM" = '1' ]; then - runcmd "${wrap:+-W$wrap}" | wtrunc | htrunctail - else - runcmd "${wrap:+-W$wrap}" | wtrunc | htrunchead - fi - else - runcmd "${wrap:+-W$wrap}" | wtrunc - fi } |