blob: 387665fa36b43963c6dab4e90ad3a157545ec635 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# -*- shell-script -*-
# gates-of-tartaros – Minimal replacement for agetty with SSH support
#
# Copyright © 2013, 2014, 2015 Mattias Andrée (m@maandree.se)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This requires KMS support and that the packages ponysay and util-say are installed.
# It will print a random pony (not speech bubble) in the lower left corner of the screen,
# as well as set a nice palette to the TTY.
_display () {
PALETTE="$(printf '\033]P0020840\033]P1CD656C\033]P232A679\033]P3CCAD47\033]P42495BE\033]P5A46EB0\033]P600A09F\033]P7D3D7CF\033]P8555753\033]P9EB5E6A\033]PA0EC287\033]PBF2CA38\033]PC00ACE0\033]PDC473D1\033]PE00C3C7\033]PFEEEEEE')"
printf '%s' "${PALETTE}"
printf '\033[H\033[2J'
pony="$(PONYSAY_SHELL_LINES=5 PONYSAY_KMS_PALETTE="${PALETTE}" ponysay -o <&2)"
lines=$(echo "${pony}" | wc -l)
height=$(stty size | cut -d ' ' -f 1)
printf '\033[%s;1H' "$(( $height - $lines + 1 ))"
printf '%s%s' "$(echo "${pony}" | sed -e 's:\x1b\[H\x1b\[2J::')" "${PALETTE}"
echo -e "\033[H\033[%sm%s (%s)\033[0m" "${ANSI_COLOR}" "${NAME}" "${tty}"
printf '\nLogin: '
}
|