aboutsummaryrefslogtreecommitdiff
path: root/ponysay.sh
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-18 17:16:05 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-18 17:16:05 +0200
commit97329adb572256572650ab0ba063d81ab9bb40e5 (patch)
treecc6d4c1357ae69321ffa436c87df0df3cb255f4d /ponysay.sh
parent2e4e6474a5aa679a59521373b95b0742671b84f1 (diff)
downloadponysay-97329adb572256572650ab0ba063d81ab9bb40e5.tar.gz
ponysay-97329adb572256572650ab0ba063d81ab9bb40e5.tar.bz2
ponysay-97329adb572256572650ab0ba063d81ab9bb40e5.zip
removing old stuff
Diffstat (limited to 'ponysay.sh')
-rwxr-xr-xponysay.sh61
1 files changed, 0 insertions, 61 deletions
diff --git a/ponysay.sh b/ponysay.sh
index 99dbec2..10aa32a 100755
--- a/ponysay.sh
+++ b/ponysay.sh
@@ -1,16 +1,9 @@
#!/usr/bin/env bash
-VERSION=1.4.1
-
-
# Get bash script directory's parent
INSTALLDIR="$(dirname $( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))"
-# Directory for installed media files
-SYSTEMSHARE="$INSTALLDIR/share/ponysay"
-HOMESHARE="${HOME}/.local/share/ponysay"
-
# Subscripts
listcmd="$INSTALLDIR/lib/ponysay/list.pl"
linklistcmd="$INSTALLDIR/lib/ponysay/linklist.pl"
@@ -30,14 +23,6 @@ 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-"
-# Directories for installed ponies files
-if [ "$TERM" = "linux" ]; then
- SYSTEMPONIES="$SYSTEMSHARE/ttyponies"
- HOMEPONIES="$HOMESHARE/ttyponies"
-else
- SYSTEMPONIES="$SYSTEMSHARE/ponies"
- HOMEPONIES="$HOMESHARE/ponies"
-fi
# Cowsay script
if [ ${0} == *ponythink ]; then
@@ -77,19 +62,6 @@ say() {
# Set PONYSAY_SHELL_LINES to default if not specified
[ "$PONYSAY_SHELL_LINES" = "" ] && PONYSAY_SHELL_LINES=2
- # Width trunction
- function wtrunc {
- if [ "$PONYSAY_FULL_WIDTH" = 'yes' ] || [ "$PONYSAY_FULL_WIDTH" = 'y' ] || [ "$PONYSAY_FULL_WIDTH" = '1' ]; then
- cat
- else
- if [ -f $truncatercmd ]; then
- $truncatercmd $scrw
- else
- cat
- fi
- fi
- }
-
# Height trunction, show top
function htrunchead {
head --lines=$(( $scrh - $PONYSAY_SHELL_LINES ))
@@ -180,36 +152,3 @@ if it actually exists under a different filename.
EOF
exit 1
fi
-
-
-# Select random pony for the set of -f arguments
-if [ ! ${#ponies[@]} == 0 ]; then
- pony="${ponies[$RANDOM%${#ponies[@]}]}"
-fi
-
-
-# Pony not a file? Search for it
-if [ ! -f $pony ]; then
- ponies=()
- [ -d $SYSTEMPONIES ] && ponies+=( "$SYSTEMPONIES"/$pony.pony )
- [ -d $HOMEPONIES ] && ponies+=( "$HOMEPONIES"/$pony.pony )
-
- if (( ${#ponies} < 1 )); then
- echo >&2 "All the ponies are missing! Call the Princess!"
- exit 1
- fi
-
- # Choose a random pony
- pony="${ponies[$RANDOM%${#ponies[@]}]}"
-fi
-
-
-# Print pony with message
-if [ -n "$*" ]; then
- # Handle a message given via arguments
- say <<<"$*"
-else
- # Handle a message given in stdin
- say
-fi
-