From 57fdde2f5e78abf097a0af2249031989de2ef0b5 Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Sat, 21 Jul 2012 10:39:24 +0200 Subject: Support ponies by name like "Apple Jack" --- ponysay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ponysay') diff --git a/ponysay b/ponysay index c856fd2..4a73cbe 100755 --- a/ponysay +++ b/ponysay @@ -270,7 +270,7 @@ while getopts $opts OPT; do case ${OPT} in v) version; exit ;; h) usage; exit ;; - f) ponies+=( "$OPTARG" ) ;; + f) ponies=($(echo $OPTARG | sed -e 's/ //g' -e 's/,/\n/')) ;; l) list; exit ;; L) linklist; exit ;; W) wrap="$OPTARG" ;; -- cgit From 991ab2cf03a895f238d07fb4c112c1200f15c984 Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Sat, 21 Jul 2012 12:54:34 +0200 Subject: Sorry :) Missed that part, fixed. --- ponysay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ponysay') diff --git a/ponysay b/ponysay index 4a73cbe..0d84cd8 100755 --- a/ponysay +++ b/ponysay @@ -270,7 +270,7 @@ while getopts $opts OPT; do case ${OPT} in v) version; exit ;; h) usage; exit ;; - f) ponies=($(echo $OPTARG | sed -e 's/ //g' -e 's/,/\n/')) ;; + f) ponies+=($(echo $OPTARG | sed -e 's/ //g')) ;; l) list; exit ;; L) linklist; exit ;; W) wrap="$OPTARG" ;; -- cgit From c6f82a5d388c3d273b1e7bc21d1149fe379f9157 Mon Sep 17 00:00:00 2001 From: Erkin Batu Altunbaş Date: Sat, 21 Jul 2012 16:30:37 +0200 Subject: tag test --- ponysay | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ponysay') diff --git a/ponysay b/ponysay index 0d84cd8..fe2ed48 100755 --- a/ponysay +++ b/ponysay @@ -1,6 +1,6 @@ -#!/usr/bin/env bash +\#!/usr/bin/env bash -version=1.0 +version=1.1 SYSTEMPONIES="/usr/share/ponysay/ponies" HOMEPONIES="${HOME}/.local/share/ponysay/ponies" SCRIPTDIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get bash script directory -- cgit From c0a9749730da46165aec40eb7217158c4cb89a74 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 21 Jul 2012 15:43:21 +0200 Subject: release correction --- ponysay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ponysay') diff --git a/ponysay b/ponysay index fe2ed48..ae71fc5 100755 --- a/ponysay +++ b/ponysay @@ -1,4 +1,4 @@ -\#!/usr/bin/env bash +#!/usr/bin/env bash version=1.1 SYSTEMPONIES="/usr/share/ponysay/ponies" -- cgit From 61eb843ded3184b2a09a1f68b9643da6e660b6b0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 21 Jul 2012 18:16:18 +0200 Subject: support for kmsponies4ponysay --- ponysay | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'ponysay') diff --git a/ponysay b/ponysay index ae71fc5..1c7ff4e 100755 --- a/ponysay +++ b/ponysay @@ -7,6 +7,10 @@ SCRIPTDIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # Get bash scri pony="*" wrap="" +kmscmd="" +[[ "$TERM" = "linux" ]] && kmscmd=$(for c in $(echo $PATH":" | sed -e 's/:/\/ponysay2kmsponysay /g'); do if [[ -f $c ]]; then echo $c; break; fi done) +[[ ! "$kmscmd" = "" ]] && TERM="-linux-" + if [ "$TERM" = "linux" ]; then SYSTEMPONIES="/usr/share/ponysay/ttyponies" HOMEPONIES="${HOME}/.local/share/ponysay/ttyponies" @@ -247,14 +251,24 @@ say() { } fi + if [[ "$kmscmd" = "" ]]; then + function runcmd { + cowcmd -f "$pony" "$@" + } + else + function runcmd { + cowcmd -f <($kmscmd "$pony") "$@" + } + fi + 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 - cowcmd -f "$pony" "${wrap:+-W$wrap}" | wtrunc | htrunctail + runcmd "${wrap:+-W$wrap}" | wtrunc | htrunctail else - cowcmd -f "$pony" "${wrap:+-W$wrap}" | wtrunc | htrunchead + runcmd "${wrap:+-W$wrap}" | wtrunc | htrunchead fi else - cowcmd -f "$pony" "${wrap:+-W$wrap}" | wtrunc + runcmd "${wrap:+-W$wrap}" | wtrunc fi } -- cgit