Showing posts with label ascii. Show all posts
Showing posts with label ascii. Show all posts

Wednesday, August 19, 2009

(S)hell fire :)




Although there's summer, you may sometimes feel cold. What can you do to warm up? Run aafire and admire beautiful ASCII art fire in the console.

Monday, August 10, 2009

Figlet - the better banner



Figlet is small tool a bit similar to described earlier (http://tuxshell.blogspot.com/2009/08/banner.html) banner command. It allows to create pretty nice ASCII art letters out of ordinary text. You can download it from http://www.figlet.org.

Installation

$ wget ftp://ftp.figlet.org/pub/figlet/program/unix/figlet222.tar.gz
$ tar zxvf figlet222.tar.gz
$ cd filglet222

We can set the default installation directory as well as the default fonts directory by editing the Makefile. I had to comment the following line:

# DEFAULTFONTDIR = fonts

to avoid installation error. Let's build and install:

$ make
$ su -c 'make install'

Usage

When no arguments are present, the program waits for input . Type what you want and see the result. It will render the text given as the first argument:

$ figlet hello world
 _          _ _                            _     _
| |__ ___| | | ___ __ _____ _ __| | __| |
| '_ \ / _ \ | |/ _ \ \ \ /\ / / _ \| '__| |/ _` |
| | | | __/ | | (_) | \ V V / (_) | | | | (_| |
|_| |_|\___|_|_|\___/ \_/\_/ \___/|_| |_|\__,_|

We can see all available fonts by listing *.flf files /usr/local/share/figlet/:

$ ls *.flf

banner.flf bubble.flf lean.flf script.flf small.flf smslant.flf
big.flf digital.flf mini.flf shadow.flf smscript.flf standard.flf
block.flf ivrit.flf mnemonic.flf slant.flf smshadow.flf term.flf


The -f switch selects the font:

$ figlet -f shadow shadow


| |
__| __ \ _` | _` | _ \\ \ \ /
\__ \ | | | ( | ( | ( |\ \ \ /
____/_| |_|\__,_|\__,_|\___/ \_/\_/

We can also set text justification with -c , -l, -r and -x switches:
$ figlet -l left

_ __ _
| | ___ / _| |_
| |/ _ \ |_| __|
| | __/ _| |_
|_|\___|_| \__|

$ figlet -c center
_
___ ___ _ __ | |_ ___ _ __
/ __/ _ \ '_ \| __/ _ \ '__|
| (_| __/ | | | || __/ |
\___\___|_| |_|\__\___|_|

$ figlet -r right
_ _ _
_ __(_) __ _| |__ | |_
| '__| |/ _` | '_ \| __|
| | | | (_| | | | | |_
|_| |_|\__, |_| |_|\__|
|___/

When sending to figlet the output from other file it's good to use -p switch. It switches the figlet into paragraph mode, which eliminates unnecessary line breaks when piping a multi-line file:

$ figlet -p < /etc/motd

The -k, -s and -S switches control the kerning of the letters. We can achieve the mirror effect by using the -R option which prints the text from right to left:

$ figlet -kR hello

_ _ _
___ | || | ___ | |__
/ _ \ | || | / _ \| '_ \
| (_) || || || __/| | | |
\___/ |_||_| \___||_| |_|

Combining figlet with tr command ale proper fonts leads us to some more interesting effects:

$ figlet -f lean hello | tr ' _/' '/  '
/////////////////////////////////////////
//// ////////////////// // ///////////
/// ////// //// // //// ////
// //// // // // // //// ///
/ //// // //////// // // //// ////
//// //// // // //// ///////
/////////////////////////////////////////
/////////////////////////////////////////

Of course we can pipe output of any command to the figlet. The imagination is the limit.

$ date | figlet
_____ _ _ _
|_ _| _ ___ / \ _ _ __ _ / / |
| || | | |/ _ \ / _ \| | | |/ _` | | | |
| || |_| | __/ / ___ \ |_| | (_| | | | |
|_| \__,_|\___| /_/ \_\__,_|\__, | |_|_|
|___/
___ ___ _________ _ ___ ____ _____ ____ _____
/ _ \ / _ \ _|___ / ___|_/ |/ _ \ / ___| ____/ ___|_ _|
| | | | (_) (_) |_ \___ (_) | | | | | | | _| \___ \ | |
| |_| |\__, |_ ___) |__) || | |_| | | |___| |___ ___) || |
\___/ /_/(_)____/____(_)_|\___/ \____|_____|____/ |_|

____ ___ ___ ___
|___ \ / _ \ / _ \ / _ \
__) | | | | | | | (_) |
/ __/| |_| | |_| |\__, |
|_____|\___/ \___/ /_/
We can run the full screen clock based on figlet:

$ watch -n1 "date +%H:%M:%S | figlet -k -c"

Saturday, August 8, 2009

ASCII Star Wars


Sometimes you can find on the web very funny and creative stuff. Someone did the whole episode of star wars in ASCII mode. You can watch it with telnet command. Type:

$ telnet towel.blinkenlights.nl

Nice watching :)

Thursday, August 6, 2009

Banner

Ever heard of ASCII art? It's kind of art where images and signs are composed of many characters. They look good if you look at them from further distance or print it on paper and hang on the wall. Banner is little tool which creates such images. Type what you want to see as huge sign as the first argument and see the result. Here's the output of command (the -w switch defines the width of the banner):

$ banner -w 40 abc