aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-07-24 16:34:44 +0200
committerMattias Andrée <maandree@operamail.com>2012-07-24 16:34:44 +0200
commit4e1655bc0bb213c001848d02342bcdcd60f4f110 (patch)
tree03fc4412252ce4b68f32c08c9df8a2ec59881c4c
parentc374d57fd365833807c2e191178848d76828e859 (diff)
downloadponysay-4e1655bc0bb213c001848d02342bcdcd60f4f110.tar.gz
ponysay-4e1655bc0bb213c001848d02342bcdcd60f4f110.tar.bz2
ponysay-4e1655bc0bb213c001848d02342bcdcd60f4f110.zip
Fix issue #41
-rwxr-xr-xponysay12
1 files changed, 8 insertions, 4 deletions
diff --git a/ponysay b/ponysay
index 0fdcb18..1afb742 100755
--- a/ponysay
+++ b/ponysay
@@ -1,19 +1,23 @@
#!/usr/bin/env bash
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
pony="*"
wrap=""
+SYSTEMPONIES="$(dirname $SCRIPTDIR)/share/ponysay"
+HOMEPONIES="${HOME}/.local/share/ponysay"
+
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"
+ SYSTEMPONIES="$SYSTEMPONIES/ttyponies"
+ HOMEPONIES="$HOMEPONIES/ttyponies"
+else
+ SYSTEMPONIES="$SYSTEMPONIES/ponies"
+ HOMEPONIES="$HOMEPONIES/ponies"
fi
if [[ "$PONYSAY_COWSAY" = "" ]]; then