SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-06-10 10:44:21

pfh
#! CrunchBanger
Registered: 2011-03-09
Posts: 189

ANSI colorschemes scripts

#!/bin/sh

# ANSI Color -- use these variables to easily have different color
#    and format output. Make sure to output the reset sequence after 
#    colors (f = foreground, b = background), and use the 'off'
#    feature for anything you turn on.

initializeANSI()
{
 esc=""

  blackf="${esc}[30m";   redf="${esc}[31m";    greenf="${esc}[32m"
  yellowf="${esc}[33m"   bluef="${esc}[34m";   purplef="${esc}[35m"
  cyanf="${esc}[36m";    whitef="${esc}[37m"
  
  blackb="${esc}[40m";   redb="${esc}[41m";    greenb="${esc}[42m"
  yellowb="${esc}[43m"   blueb="${esc}[44m";   purpleb="${esc}[45m"
  cyanb="${esc}[46m";    whiteb="${esc}[47m"

  boldon="${esc}[1m";    boldoff="${esc}[22m"
  italicson="${esc}[3m"; italicsoff="${esc}[23m"
  ulon="${esc}[4m";      uloff="${esc}[24m"
  invon="${esc}[7m";     invoff="${esc}[27m"

  reset="${esc}[0m"
}

# note in this first use that switching colors doesn't require a reset
# first - the new color overrides the old one.

clear 

initializeANSI

cat << EOF

 ${yellowf}  ▄███████▄${reset}   ${redf}  ▄██████▄${reset}    ${greenf}  ▄██████▄${reset}    ${bluef}  ▄██████▄${reset}    ${purplef}  ▄██████▄${reset}    ${cyanf}  ▄██████▄${reset}
 ${yellowf}▄█████████▀▀${reset}  ${redf}▄${whitef}█▀█${redf}██${whitef}█▀█${redf}██▄${reset}  ${greenf}▄${whitef}█▀█${greenf}██${whitef}█▀█${greenf}██▄${reset}  ${bluef}▄${whitef}█▀█${bluef}██${whitef}█▀█${bluef}██▄${reset}  ${purplef}▄${whitef}█▀█${purplef}██${whitef}█▀█${purplef}██▄${reset}  ${cyanf}▄${whitef}█▀█${cyanf}██${whitef}█▀█${cyanf}██▄${reset}
 ${yellowf}███████▀${reset}      ${redf}█${whitef}▄▄█${redf}██${whitef}▄▄█${redf}███${reset}  ${greenf}█${whitef}▄▄█${greenf}██${whitef}▄▄█${greenf}███${reset}  ${bluef}█${whitef}▄▄█${bluef}██${whitef}▄▄█${bluef}███${reset}  ${purplef}█${whitef}▄▄█${purplef}██${whitef}▄▄█${purplef}███${reset}  ${cyanf}█${whitef}▄▄█${cyanf}██${whitef}▄▄█${cyanf}███${reset}
 ${yellowf}███████▄${reset}      ${redf}████████████${reset}  ${greenf}████████████${reset}  ${bluef}████████████${reset}  ${purplef}████████████${reset}  ${cyanf}████████████${reset}
 ${yellowf}▀█████████▄▄${reset}  ${redf}██▀██▀▀██▀██${reset}  ${greenf}██▀██▀▀██▀██${reset}  ${bluef}██▀██▀▀██▀██${reset}  ${purplef}██▀██▀▀██▀██${reset}  ${cyanf}██▀██▀▀██▀██${reset}
 ${yellowf}  ▀███████▀${reset}   ${redf}▀   ▀  ▀   ▀${reset}  ${greenf}▀   ▀  ▀   ▀${reset}  ${bluef}▀   ▀  ▀   ▀${reset}  ${purplef}▀   ▀  ▀   ▀${reset}  ${cyanf}▀   ▀  ▀   ▀${reset}
 
 ${boldon}${yellowf}  ▄███████▄   ${redf}  ▄██████▄    ${greenf}  ▄██████▄    ${bluef}  ▄██████▄    ${purplef}  ▄██████▄    ${cyanf}  ▄██████▄${reset}
 ${boldon}${yellowf}▄█████████▀▀  ${redf}▄${whitef}█▀█${redf}██${whitef}█▀█${redf}██▄  ${greenf}▄${whitef}█▀█${greenf}██${whitef}█▀█${greenf}██▄  ${bluef}▄${whitef}█▀█${bluef}██${whitef}█▀█${bluef}██▄  ${purplef}▄${whitef}█▀█${purplef}██${whitef}█▀█${purplef}██▄  ${cyanf}▄${whitef}█▀█${cyanf}██${whitef}█▀█${cyanf}██▄${reset}
 ${boldon}${yellowf}███████▀      ${redf}█${whitef}▄▄█${redf}██${whitef}▄▄█${redf}███  ${greenf}█${whitef}▄▄█${greenf}██${whitef}▄▄█${greenf}███  ${bluef}█${whitef}▄▄█${bluef}██${whitef}▄▄█${bluef}███  ${purplef}█${whitef}▄▄█${purplef}██${whitef}▄▄█${purplef}███  ${cyanf}█${whitef}▄▄█${cyanf}██${whitef}▄▄█${cyanf}███${reset}
 ${boldon}${yellowf}███████▄      ${redf}████████████  ${greenf}████████████  ${bluef}████████████  ${purplef}████████████  ${cyanf}████████████${reset}
 ${boldon}${yellowf}▀█████████▄▄  ${redf}██▀██▀▀██▀██  ${greenf}██▀██▀▀██▀██  ${bluef}██▀██▀▀██▀██  ${purplef}██▀██▀▀██▀██  ${cyanf}██▀██▀▀██▀██${reset}
 ${boldon}${yellowf}  ▀███████▀   ${redf}▀   ▀  ▀   ▀  ${greenf}▀   ▀  ▀   ▀  ${bluef}▀   ▀  ▀   ▀  ${purplef}▀   ▀  ▀   ▀  ${cyanf}▀   ▀  ▀   ▀${reset}

EOF

Last edited by pfh (2011-06-10 14:20:11)

Offline

Help fund CrunchBang, donate to the project!

#2 2011-06-10 10:52:29

muzieca
#! Die Hard
From: /home
Registered: 2010-08-28
Posts: 1,152

Re: ANSI colorschemes scripts


Life is really simple, but we insist on making it complicated. --Confucius--

Offline

#3 2011-06-10 13:54:54

safetycopy
urban legend
From: The Chatsubo
Registered: 2010-04-03
Posts: 1,311

Re: ANSI colorschemes scripts

Offline

#4 2011-06-10 14:19:22

pfh
#! CrunchBanger
Registered: 2011-03-09
Posts: 189

Re: ANSI colorschemes scripts

esc=""

Offline

#5 2011-06-10 14:21:01

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Re: ANSI colorschemes scripts

initializeANSI()
{
  esc="ESC"

Last edited by gutterslob (2011-06-10 14:22:12)


Point & Squirt

Offline

#6 2011-06-10 14:24:44

safetycopy
urban legend
From: The Chatsubo
Registered: 2010-04-03
Posts: 1,311

Re: ANSI colorschemes scripts

@pfh & @gutterslob - thanks mates, that did it smile

Offline

#7 2011-06-10 15:24:30

pfh
#! CrunchBanger
Registered: 2011-03-09
Posts: 189

Re: ANSI colorschemes scripts

Offline

#8 2011-06-10 15:35:15

safetycopy
urban legend
From: The Chatsubo
Registered: 2010-04-03
Posts: 1,311

Re: ANSI colorschemes scripts

^ Yep - good to go now smile Thanks for posting them!

Offline

#9 2011-06-10 15:47:57

chaanakya
#! Die Hard
Registered: 2010-12-30
Posts: 940

Re: ANSI colorschemes scripts

I wonder if you could somehow rewrite Pacman (made entirely out of a shell script) using the first script as a guideline...that would be so cool big_smile

Offline

#10 2011-06-11 02:36:36

muzieca
#! Die Hard
From: /home
Registered: 2010-08-28
Posts: 1,152

Re: ANSI colorschemes scripts

#!/bin/sh

# ANSI Color -- use these variables to easily have different color
#    and format output. Make sure to output the reset sequence after 
#    colors (f = foreground, b = background), and use the 'off'
#    feature for anything you turn on.

initializeANSI()
{
  esc=""

  blackf="${esc}[30m";   redf="${esc}[31m";    greenf="${esc}[32m"
  yellowf="${esc}[33m"   bluef="${esc}[34m";   purplef="${esc}[35m"
  cyanf="${esc}[36m";    whitef="${esc}[37m"
  
  blackb="${esc}[40m";   redb="${esc}[41m";    greenb="${esc}[42m"
  yellowb="${esc}[43m"   blueb="${esc}[44m";   purpleb="${esc}[45m"
  cyanb="${esc}[46m";    whiteb="${esc}[47m"

  boldon="${esc}[1m";    boldoff="${esc}[22m"
  italicson="${esc}[3m"; italicsoff="${esc}[23m"
  ulon="${esc}[4m";      uloff="${esc}[24m"
  invon="${esc}[7m";     invoff="${esc}[27m"

  reset="${esc}[0m"
}

# note in this first use that switching colors doesn't require a reset
# first - the new color overrides the old one.

initializeANSI

cat << EOF

  ${boldon}${redf}    █    ${reset}    ${boldon}${greenf}    █    ${reset}    ${boldon}${yellowf}    █    ${reset}    ${boldon}${bluef}    █    ${reset}    ${boldon}${purplef}    █    ${reset}    ${boldon}${cyanf}    █    ${reset}
  ${boldon}${redf}▄▄  █  ▄▄${reset}    ${boldon}${greenf}▄▄  █  ▄▄${reset}    ${boldon}${yellowf}▄▄  █  ▄▄${reset}    ${boldon}${bluef}▄▄  █  ▄▄${reset}    ${boldon}${purplef}▄▄  █  ▄▄${reset}    ${boldon}${cyanf}▄▄  █  ▄▄${reset}
  ${boldon}${redf}███▀▀▀███${reset}    ${boldon}${greenf}███▀▀▀███${reset}    ${boldon}${yellowf}███▀▀▀███${reset}    ${boldon}${bluef}███▀▀▀███${reset}    ${boldon}${purplef}███▀▀▀███${reset}    ${boldon}${cyanf}███▀▀▀███${reset}
  ${boldon}${redf}███ █ ███${reset}    ${boldon}${greenf}███ █ ███${reset}    ${boldon}${yellowf}███ █ ███${reset}    ${boldon}${bluef}███ █ ███${reset}    ${boldon}${purplef}███ █ ███${reset}    ${boldon}${cyanf}███ █ ███${reset}
  ${boldon}${redf}██ ▀▀▀ ██${reset}    ${boldon}${greenf}██ ▀▀▀ ██${reset}    ${boldon}${yellowf}██ ▀▀▀ ██${reset}    ${boldon}${bluef}██ ▀▀▀ ██${reset}    ${boldon}${purplef}██ ▀▀▀ ██${reset}    ${boldon}${cyanf}██ ▀▀▀ ██${reset}
  
  ${redf}    █    ${reset}    ${greenf}    █    ${reset}    ${yellowf}    █    ${reset}    ${bluef}    █    ${reset}    ${purplef}    █    ${reset}    ${cyanf}    █    ${reset}
  ${redf}▄▄  █  ▄▄${reset}    ${greenf}▄▄  █  ▄▄${reset}    ${yellowf}▄▄  █  ▄▄${reset}    ${bluef}▄▄  █  ▄▄${reset}    ${purplef}▄▄  █  ▄▄${reset}    ${cyanf}▄▄  █  ▄▄${reset}
  ${redf}███▀▀▀███${reset}    ${greenf}███▀▀▀███${reset}    ${yellowf}███▀▀▀███${reset}    ${bluef}███▀▀▀███${reset}    ${purplef}███▀▀▀███${reset}    ${cyanf}███▀▀▀███${reset}
  ${redf}███ █ ███${reset}    ${greenf}███ █ ███${reset}    ${yellowf}███ █ ███${reset}    ${bluef}███ █ ███${reset}    ${purplef}███ █ ███${reset}    ${cyanf}███ █ ███${reset}
  ${redf}██ ▀▀▀ ██${reset}    ${greenf}██ ▀▀▀ ██${reset}    ${yellowf}██ ▀▀▀ ██${reset}    ${bluef}██ ▀▀▀ ██${reset}    ${purplef}██ ▀▀▀ ██${reset}    ${cyanf}██ ▀▀▀ ██${reset}  
  
  

Life is really simple, but we insist on making it complicated. --Confucius--

Offline

#11 2011-06-11 06:26:45

FlyHigh
#! Member
Registered: 2011-05-07
Posts: 51

Re: ANSI colorschemes scripts

Where do you put these scripts?

Offline

#12 2011-06-11 08:18:28

pfh
#! CrunchBanger
Registered: 2011-03-09
Posts: 189

Re: ANSI colorschemes scripts

@chaanakya Cannot promise anything but I'll try to do that when I get some free time.

@Muzieca Yeah man, thanks for that. Excellent tank script. Cool stuff.

@FlyHigh You can make the scripts executable (i.e. >> chmod +x script_name) and put them in any of your "bin" folders. I typically make a bin folder in my home directory and include it in my PATH variable

Offline

#13 2011-06-11 08:45:52

FlyHigh
#! Member
Registered: 2011-05-07
Posts: 51

Re: ANSI colorschemes scripts

Last edited by FlyHigh (2011-06-11 08:46:53)

Offline

#14 2011-06-11 09:47:25

pfh
#! CrunchBanger
Registered: 2011-03-09
Posts: 189

Re: ANSI colorschemes scripts

^^ Dont know really. Could it be the font you are using in you terminal??
I use terminus

Offline

#15 2011-06-11 11:27:24

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Re: ANSI colorschemes scripts

^^^It's either the font or the terminal emulator, or a combination of both. I've noticed terminator of xfce4-terminal have a strong tendency to render lines and blocks like those in FlyHigh's shot.


Point & Squirt

Offline

#16 2011-06-11 12:37:58

pfh
#! CrunchBanger
Registered: 2011-03-09
Posts: 189

Re: ANSI colorschemes scripts

#!/bin/sh

# ANSI Color -- use these variables to easily have different color
#    and format output. Make sure to output the reset sequence after 
#    colors (f = foreground, b = background), and use the 'off'
#    feature for anything you turn on.

initializeANSI()
{
  esc=""

  blackf="${esc}[30m";   redf="${esc}[31m";    greenf="${esc}[32m"
  yellowf="${esc}[33m"   bluef="${esc}[34m";   purplef="${esc}[35m"
  cyanf="${esc}[36m";    whitef="${esc}[37m"
  
  blackb="${esc}[40m";   redb="${esc}[41m";    greenb="${esc}[42m"
  yellowb="${esc}[43m"   blueb="${esc}[44m";   purpleb="${esc}[45m"
  cyanb="${esc}[46m";    whiteb="${esc}[47m"

  boldon="${esc}[1m";    boldoff="${esc}[22m"
  italicson="${esc}[3m"; italicsoff="${esc}[23m"
  ulon="${esc}[4m";      uloff="${esc}[24m"
  invon="${esc}[7m";     invoff="${esc}[27m"

  reset="${esc}[0m"
}

# note in this first use that switching colors doesn't require a reset
# first - the new color overrides the old one.

clear
initializeANSI

cat << EOF

 ${redf}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗  ${greenf}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗  ${yellowf}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗
 ${boldon}${redf}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝  ${greenf}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝  ${yellowf}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝${reset}
  ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 
 ${bluef}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗  ${purplef}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗  ${cyanf}╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗
 ${boldon}${bluef}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝  ${purplef}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝  ${cyanf}╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝${reset}


EOF

Offline

#17 2011-06-11 12:44:58

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,207

Re: ANSI colorschemes scripts

^^ Awesome!!


Point & Squirt

Offline

#18 2011-06-11 14:13:26

pfh
#! CrunchBanger
Registered: 2011-03-09
Posts: 189

Re: ANSI colorschemes scripts

Offline

#19 2011-06-11 15:46:04

aaro
#! Die Hard
Registered: 2009-11-15
Posts: 648

Re: ANSI colorschemes scripts


- closed account - gone to better places -

Offline

#20 2011-06-11 22:23:28

FlyHigh
#! Member
Registered: 2011-05-07
Posts: 51

Re: ANSI colorschemes scripts

Offline

#21 2011-06-12 00:02:57

muzieca
#! Die Hard
From: /home
Registered: 2010-08-28
Posts: 1,152

Re: ANSI colorschemes scripts

>>FlyHigh
I'm using URxvt (Rxvt-Unicode). Most of us are using URxvt as our terminal emulator. smile


Life is really simple, but we insist on making it complicated. --Confucius--

Offline

#22 2011-06-12 07:33:03

FlyHigh
#! Member
Registered: 2011-05-07
Posts: 51

Re: ANSI colorschemes scripts

Offline

#23 2011-06-12 08:18:37

muzieca
#! Die Hard
From: /home
Registered: 2010-08-28
Posts: 1,152

Re: ANSI colorschemes scripts


Life is really simple, but we insist on making it complicated. --Confucius--

Offline

#24 2011-06-12 12:31:56

pfh
#! CrunchBanger
Registered: 2011-03-09
Posts: 189

Re: ANSI colorschemes scripts

@aaro Thanks for the info.

@FlyHigh I use URxvt with Terminus font

Offline

Be excellent to each other!

#25 2011-06-12 17:10:11

luc
#! Die Hard
From: Munich, Germany
Registered: 2010-03-21
Posts: 597

Re: ANSI colorschemes scripts

echo -e "\033[41;m   " && echo "   "&& echo -e "\033[m"

Last edited by luc (2011-06-12 17:13:40)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo