mirror of
https://github.com/erkin/ponysay.git
synced 2025-02-16 17:44:23 +01:00
TTY support!!
This commit is contained in:
parent
e71522c0b8
commit
76112f7bc5
1 changed files with 10 additions and 1 deletions
11
ponysay
11
ponysay
|
@ -6,6 +6,11 @@ HOMEPONIES="${HOME}/.ponies"
|
|||
pony="*"
|
||||
wrap=
|
||||
|
||||
if [ "$TERM" = "linux" ]; then
|
||||
SYSTEMPONIES=/usr/share/ttyponies
|
||||
HOMEPONIES="${HOME}/.ttyponies"
|
||||
fi
|
||||
|
||||
cmd=cowsay
|
||||
[[ ${0} == *ponythink ]] && cmd=cowthink
|
||||
|
||||
|
@ -43,7 +48,11 @@ EOF
|
|||
say() {
|
||||
# Ponies use UTF-8 drawing characters. Prevent a Perl warning.
|
||||
export PERL_UNICODE=S
|
||||
|
||||
|
||||
if [ "$TERM" = "linux" ]; then
|
||||
echo -ne '\ec'
|
||||
fi
|
||||
|
||||
exec "$cmd" -f "$pony" "${wrap:+-W$wrap}" | (ponysaytruncater `tput cols || echo 0` 2>/dev/null || ./ponysaytruncater `tput cols || echo 0` 2>/dev/null || cat)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue