3

I want to the Ubuntu terminal to show art like this picture:

http://1.bp.blogspot.com/-X9_7lpr3y_I/Tz5xkBHO-BI/AAAAAAAAAWo/OWF11KTnPNA/s320/msfconsole.png

How to do that? I want put my own logo using the word character. I would like to arrange it and form a logo.

Please teach me the way..

saji89
  • 12,007
  • If it is correct that OP wishes to have a custom image as background for the terminal,the answer may be here: http://askubuntu.com/a/225828/25656 and the current question maybe a duplicate of http://askubuntu.com/q/107444/25656 –  Jan 22 '13 at 06:19
  • @vasa1, He is asking about showing ASCII graphics like stuff on terminal launch. – saji89 Jan 22 '13 at 06:24
  • 1
    I'm not sure; there appear to be gradient effects present ... see the blue horizontal rectangles. Anyway, it's a pretty poorly worded question. I tried to edit it but gave up. –  Jan 22 '13 at 06:27
  • @vasa1, I agree taht the question is poorly worded. :) – saji89 Jan 22 '13 at 06:37

2 Answers2

6

Easiest method:
Use fortune and cowsay.

  • Install fortune and cowsay:

    sudo apt-get install fortune cowsay
    
  • At the end of .bashrc file in your Home directory add the following line:

    fortune | cowsay -f tux
    

Courtesy: http://community.linuxmint.com/tutorial/view/886

Sample Output:

 _________________________________________
/ Your aims are high, and you are capable \
\ of much.                                /
 -----------------------------------------
   \
    \
        .--.
       |o_o |
       |:_/ |
      //   \ \
     (|     | )
    /'\_   _/`\
    \___)=(___/

saji@geeklap:~$ 

Another method: Get a good ASCII art from some site(or you can create on your own), create a new file in your home directory, paste the ASCII art in that file(as it is). Let us save the file as asciiart for now ( you can use any other name you like, just remember to use that name in the .bashrc file). In the .bashrc file, put the last line as:

cat acsiiart

Base idea from: http://dorkbyte.com/2012/08/05/trick-out-your-terminal-with-ascii-art/

saji89
  • 12,007
1

In the general case, you can manipulate the terminal display using special character sequences. You can find useful lists of the special commands the terminal understands here or here. Note that these commands are not being interpreted by the shell (eg, bash), but by the terminal emulator (eg gnome-terminal, xterm, etc).

(To further complicate matters, there are different types of terminal which can be emulated. The above character sequences apply to an emulated VT100 terminal, which is probably a safe bet. These different types of terminals now emulated in software correspond to physical terminals which could be connected to Unix mainframes of lore.)

All special commands start with an escape character, after which the terminal interprets the next few characters.

To change the text colour to blue, for example

$ echo -e "\033[34mhello blue world\033[0m"

\033 is the code for the ESCAPE character, which starts the sequence. [34m sets the text attribute 34, which is foreground colour blue. The text hello blue world is then echoed as normal, except that the attributes currently used for printing have changed (to blue text), and finally the escape sequence and command [0m returns text printing to normal. (echo -e ensures the sequence \033 is interpreted as a character code and not the four characters \ 0 3 3).

Attempting to do anything complex using these commands manually will very quickly give you a headache.

The curses library provides an abstraction layer for making user interfaces on a terminal. The python binding is probably a good place to start if you want to try it out - but be warned, the library is pretty arcane and the documentation doubly so.

For the case of trying to output graphics, the correct tool is probably libcaca.

chronitis
  • 12,367