aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-09-30 00:34:17 +0200
committerMattias Andrée <maandree@operamail.com>2013-09-30 00:34:17 +0200
commit241152feaa57707adc7d1a7b3f654579188f03ef (patch)
treec3f02515f7422e45f046b7631649f91fa6c05185
parentgrammaro (diff)
downloadgates-of-tartaros-241152feaa57707adc7d1a7b3f654579188f03ef.tar.gz
gates-of-tartaros-241152feaa57707adc7d1a7b3f654579188f03ef.tar.bz2
gates-of-tartaros-241152feaa57707adc7d1a7b3f654579188f03ef.tar.xz
improve example gotrc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--gotrc10
1 files changed, 7 insertions, 3 deletions
diff --git a/gotrc b/gotrc
index 7fb9ea2..94f9f68 100644
--- a/gotrc
+++ b/gotrc
@@ -3,7 +3,11 @@
PALETTE=$'\e]P0020840\e]P1CD656C\e]P232A679\e]P3CCAD47\e]P42495BE\e]P5A46EB0\e]P600A09F\e]P7D3D7CF\e]P8555753\e]P9EB5E6A\e]PA0EC287\e]PBF2CA38\e]PC00ACE0\e]PDC473D1\e]PE00C3C7\e]PFEEEEEE'
echo -n "${PALETTE}"
echo -en '\e[H\e[2J\e[?8c'
-PONYSAY_SHELL_LINES=5 PONYSAY_KMS_PALETTE="${PALETTE}" ponysay -o
-echo "${PALETTE}"
-echo -en "\e[${ANSI_COLOR}m${NAME} (${tty}) Login: \e[00m"
+pony="$(PONYSAY_SHELL_LINES=5 PONYSAY_KMS_PALETTE="${PALETTE}" ponysay -o <&2)"
+lines=$(wc -l <<< "${pony}")
+height=$(stty size | cut -d ' ' -f 1)
+echo -n $'\e['"$(( $height - $lines + 1 ));1H$(sed -e 's:\x1b\[H\x1b\[2J::' <<< "${pony}")${PALETTE}"$'\e[H'
+echo -e "\e[${ANSI_COLOR}m${NAME} (${tty})\e[00m"
+echo
+echo -n 'Login: '