You are not logged in.

#1 2009-05-11 20:21:35

greenfish
Member
From: eating fish in /dev/null
Registered: 2008-08-30
Posts: 229

[SOLVED] how do you get ASCII in a terminal?

http://www.youtube.com/watch?v=iJpSQonl … annel_page

Time index: 1:34

That guy has a moose above his hostname. I thought the only way to add anything was manipulating PS1, but that moose is above his hostname?

Anyone know how to add something similar like that, maybe archs logo? cool

Last edited by greenfish (2009-05-17 16:16:09)


ARCH64 archSKYNET server AMD  Phenom(tm) II X2 550 HDD 6TB Ram 8GB
Hobbies: Running, Pistol Marksmanship, Classic Music

Offline

#2 2009-05-11 20:33:00

deej
Member
Registered: 2008-02-08
Posts: 395

Re: [SOLVED] how do you get ASCII in a terminal?

That's just the output of 'fortune | cowsay' smile:):)
Both packages are available: just issue the above command in a terminal.

Deej

Offline

#3 2009-05-11 20:44:27

greenfish
Member
From: eating fish in /dev/null
Registered: 2008-08-30
Posts: 229

Re: [SOLVED] how do you get ASCII in a terminal?

deej wrote:

That's just the output of 'fortune | cowsay' smile:):)
Both packages are available: just issue the above command in a terminal.

Deej

I just did what you told me and yeah they worked great, thanks cool

But is there a way to have another ASCII art in your terminal?


ARCH64 archSKYNET server AMD  Phenom(tm) II X2 550 HDD 6TB Ram 8GB
Hobbies: Running, Pistol Marksmanship, Classic Music

Offline

#4 2009-05-11 20:54:48

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: [SOLVED] how do you get ASCII in a terminal?

Add lines of

echo "!@#$%^&*()"

to, for example, ~/.bashrc, and you will have ASCII art of your choice in the terminal.

Add the thing below to /etc/issue if you want to have nice Arch logo with additional info above login in every virtual console (taken from some other thread)

[H[2J
                                                            [1;30m| [34m\s \r
       [36;1m/\\                      [37m||     [36m| |                   [30m|
      [36m/  \\                     [37m||     [36m|     _               [30m| [32m\t
     [1;36m/ [0;36m.. [1m\\   [37m//==\\\\ ||/= /==\\ ||/=\\  [36m| | |/ \\ |  | \\ /     [30m| [32m\d
    [0;36m/ .  . \\  [37m||  || ||   |    ||  || [36m| | |  | |  |  X      [1;30m|
   [0;36m/  .  .  \\ [37m\\\\==/| ||   \\==/ ||  || [36m| | |  | \\_/| / \\     [1;30m| [31m\U
  [0;36m/ ..    .. \\   [0;37mA simple, lightweight linux distribution.  [1;30m|
 [0;36m/_'        `_\\                                             [1;30m| [35m\l [0mon [1;33m\n
 [0m

Last edited by lucke (2009-05-11 20:59:30)

Offline

#5 2009-05-11 23:31:29

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: [SOLVED] how do you get ASCII in a terminal?

The terminal was set up to show those things on login.

If you watch the video thru until the unrar command finishes you will see the prompt a second time without the moose or cow.

I have birthday set up in mine.


Knute

Offline

#6 2009-05-17 16:15:28

greenfish
Member
From: eating fish in /dev/null
Registered: 2008-08-30
Posts: 229

Re: [SOLVED] how do you get ASCII in a terminal?

Thanks a lot guys ^_^


ARCH64 archSKYNET server AMD  Phenom(tm) II X2 550 HDD 6TB Ram 8GB
Hobbies: Running, Pistol Marksmanship, Classic Music

Offline

#7 2009-05-18 21:17:14

makimaki
Member
From: Ireland
Registered: 2009-04-02
Posts: 109

Re: [SOLVED] how do you get ASCII in a terminal?

lucke wrote:

Add lines of

echo "!@#$%^&*()"

to, for example, ~/.bashrc, and you will have ASCII art of your choice in the terminal.

Add the thing below to /etc/issue if you want to have nice Arch logo with additional info above login in every virtual console (taken from some other thread)

[H[2J
                                                            [1;30m| [34m\s \r
       [36;1m/\\                      [37m||     [36m| |                   [30m|
      [36m/  \\                     [37m||     [36m|     _               [30m| [32m\t
     [1;36m/ [0;36m.. [1m\\   [37m//==\\\\ ||/= /==\\ ||/=\\  [36m| | |/ \\ |  | \\ /     [30m| [32m\d
    [0;36m/ .  . \\  [37m||  || ||   |    ||  || [36m| | |  | |  |  X      [1;30m|
   [0;36m/  .  .  \\ [37m\\\\==/| ||   \\==/ ||  || [36m| | |  | \\_/| / \\     [1;30m| [31m\U
  [0;36m/ ..    .. \\   [0;37mA simple, lightweight linux distribution.  [1;30m|
 [0;36m/_'        `_\\                                             [1;30m| [35m\l [0mon [1;33m\n
 [0m

I have to say, that's really cool.


====* -- Joke
    O
    \|/ --- Me
    / \             Whooooosh

Offline

#8 2013-06-10 15:59:25

Jindur
Member
Registered: 2011-09-29
Posts: 184

Re: [SOLVED] how do you get ASCII in a terminal?

lucke wrote:

Add lines of

echo "!@#$%^&*()"

to, for example, ~/.bashrc, and you will have ASCII art of your choice in the terminal.

Add the thing below to /etc/issue if you want to have nice Arch logo with additional info above login in every virtual console (taken from some other thread)

[H[2J
                                                            [1;30m| [34m\s \r
       [36;1m/\\                      [37m||     [36m| |                   [30m|
      [36m/  \\                     [37m||     [36m|     _               [30m| [32m\t
     [1;36m/ [0;36m.. [1m\\   [37m//==\\\\ ||/= /==\\ ||/=\\  [36m| | |/ \\ |  | \\ /     [30m| [32m\d
    [0;36m/ .  . \\  [37m||  || ||   |    ||  || [36m| | |  | |  |  X      [1;30m|
   [0;36m/  .  .  \\ [37m\\\\==/| ||   \\==/ ||  || [36m| | |  | \\_/| / \\     [1;30m| [31m\U
  [0;36m/ ..    .. \\   [0;37mA simple, lightweight linux distribution.  [1;30m|
 [0;36m/_'        `_\\                                             [1;30m| [35m\l [0mon [1;33m\n
 [0m

Those "[;m" control characters aren't processed for me but instead are printed as plain text hmm What do I have to modify to enable them?

Offline

#9 2013-06-10 16:07:36

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,725

Re: [SOLVED] how do you get ASCII in a terminal?

Jindur,
I hope you get an answer, but I am afraid I don't know it myself.  Be aware that the post to which you responded is, er, a bit long-in-the-tooth tongue  (four years!).  Also, I have not seen makimaki around all year.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#10 2013-06-10 16:22:44

Jindur
Member
Registered: 2011-09-29
Posts: 184

Re: [SOLVED] how do you get ASCII in a terminal?

Ok, figured it out. Each of the "[..." actually needs to be prefixed with an (non-printable) ESCAPE character, ASCII code #27.
Since they're non-printable they cannot be displayed in this forum. :-p
I just wrote a little tool that writes a code-27 char in front of every "[" and that works.

//File 'issue-make.c'
//Create a usable 'issue' file (place it at /etc/issue) from various weirdly formatted text files.
//It accepts [... or [[... or ^[... escape sequences.
//By Jindur for bbs.archlinux.org. (Use/modify/hack/distribute/as you wish, just don't sell it.. as if lol).
//Maybe you don't want single [ to be recognized as ESC sequence. Delete the code lines then i guess.
#include <stdio.h>

int main(int argc, char *argv[])
{
	char buf[256], buf2[256];
	int n, n2;
	FILE *f, *f2;
	int just_converted = 0;

	if (argc < 2)
	{
		printf("This tool converts escape sequences ^[.. [[.. and [.. into real escape sequences.\n");
		printf("Enter filename of an ascii art file you wish to convert into a usable 'issue' file.\n");
		printf("This will overwrite an existing 'issue' file in the current directory.\n");
		printf("Example:  issue-make my-cool-art.txt\n");
		return 1;
	}

	f = fopen(argv[1], "r");
	if (!f)
	{
		printf("Error: Could not open input file for reading.\n");
		return 2;
	}
	f2 = fopen("issue", "w");
	if (!f2)
	{
		printf("Error: Could not open 'issue' file for writing.\n");
		return 3;
	}
	while (fgets(buf, 256, f))
	{
		n = -1;
		n2 = -1;
		do {
			n++;
			n2++;
			//case 1: sequence ^[...
			if (buf[n] == '^' && buf[n + 1] == '[')
			{
				n++;
				buf2[n2] = 27;
				just_converted = -1;
			}
			//case 2/3: sequence [ or [[
			else if (buf[n] == '[' && !just_converted)
			{
				if (buf[n + 1] == '[')
				{
					buf2[n2] = 27;
					just_converted = -1;
				}
				else
				{
					buf2[n2] = 27;
					n2++;
					buf2[n2] = '[';
					just_converted = -1;
				}
			}
			else
			{
				buf2[n2] = buf[n];
				just_converted = 0;
			}
		} while (buf[n]);
		fprintf(f2, "%s", buf2);
	}
	fclose (f2);
	fclose (f);
	return 0;
}

Use 'gcc' to compile.

Last edited by Jindur (2013-06-10 17:01:44)

Offline

#11 2013-06-10 16:35:18

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] how do you get ASCII in a terminal?

I'm not sure I understand, have you tried

echo -e '\e[1;36m/ [0;36m.. [1m\\'

or whatever?
'\e' may be that escape character.

Last edited by karol (2013-06-10 16:35:37)

Offline

#12 2013-06-10 16:45:09

Jindur
Member
Registered: 2011-09-29
Posts: 184

Re: [SOLVED] how do you get ASCII in a terminal?

karol wrote:

I'm not sure I understand, have you tried

echo -e '\e[1;36m/ [0;36m.. [1m\\'

or whatever?
'\e' may be that escape character.

Yeah I just figured that if you want to do it manually you can do it with echo ... \e. At first I thought that the "[;m" stuff is somehow automatically recognized by the terminal^^ because he just wrote "put this into /etc/issue" without mentioning that you need to actually write echo lines to convert it first or anything.
Well I solved that with the little program above. I found differently "encoded" ascii art by some people on the forums, so I made it take care of the different escape sequence styles they used.


Hm I found the ascii art too colourful. Here's a modified version.

[H[2J
                                                            [1;30m| [34m\s \r
       [36;1m/\\                      [37m||     [36m| |                   [30m|
      [36m/  \\                     [37m||     [36m|     _               [30m| [32m\t
     [1;36m/ [0;36m   [1m\\   [37m//==\\\\ ||/= /==\\ ||/=\\  [36m| | |/ \\ |  | \\ /     [30m| [32m\d
    [0;36m/      \\  [37m||  || ||   |    ||  || [36m| | |  | |  |  X      [1;30m|
   [0;36m/  .--.  \\ [37m\\\\==/| ||   \\==/ ||  || [36m| | |  | \\_/| / \\     [1;30m| [32m\U
  [0;36m/ ..    .. \\                                              [1;30m|
 [0;36m/_'        `_\\                                             [1;30m| [36m\l [0mon [1;36m\n
 [0m

Last edited by Jindur (2013-06-10 17:08:23)

Offline

Board footer

Powered by FluxBB