S
S
SOTVM2017-09-26 11:56:14
linux
SOTVM, 2017-09-26 11:56:14

How to colorize cowsay and fortunes output in linux terminal?

Actually the question is in the topic title.
dcb635198e8c43808e32fda6b0785bb8.png
ps
I can’t figure out how to draw fortunes in one color, and cowsay in another.
now in ~/.bashrc registered
fortune | cowsay -f /home/svm/.cowsay.cow | lolcat -F 7.009
the text is hard to read, I would like the fortunes output to be in a certain color.
735d403d911b1527c4c94bbdd2d45baf9c11075d
ps
in short, as I wanted, I didn’t have the mind to do it, I
made it even cooler:
installed xcowsay
sudo apt-install xcowsay
created a config file ~/.config/xcowsay

at_x = 100 # координаты вывода изображения в пикселях от левого верхнего угла
at_y = 160 #
#cow_size = large # указывает ,что картинка /usr/share/xcowsay/cow_<b>large</b>.png
alt_image=.icons/douel_head.png # так можно задать путь к своей картинке
display_time = 4000 #время отображения в мс.

added his picture of the "default cow", the path is specified in the file ~/.config/xcowsay alt_image
in ~/.bashrc added/changed lines
if [ -x /usr/bin/mint-fortune ]; then
     fortune | xcowsay
fi

as a result, we have such a talking head ㋛
754dded12e5fe355c97471b4ff01b6dab09c04ab
PS
did as I originally wanted
in ~/.bashrc

if [ -x /usr/bin/mint-fortune ]; then
fortune | cowsay > /tmp/cowsay ;
grep -e '--------$' /tmp/cowsay -B50 -A0 | lolcat -F 0.0033 ;
tail -n 20 /tmp/cowsay | lolcat -a -s 500 -F 3 ;echo " " ; sleep4s; clear;
fi

we have such a picture
59cb9e74874ca163198250.gif

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2017-09-26
@sotvm

perl console colorize ,
tyts

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question