SEARCH

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

You are not logged in.

#101 2011-12-18 10:15:32

nore
>2^9
From: Lakeland
Registered: 2009-11-28
Posts: 740

Re: ANSI colorschemes scripts

sudo apt-get install gucharmap

Offline

Help fund CrunchBang, donate to the project!

#102 2011-12-18 12:41:16

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: ANSI colorschemes scripts

^ thanks! had some trouble with the other suggestion, suppose i'll do it the lazy way since i won't be using it that often.

Offline

#103 2011-12-19 00:49:03

anthony
Member
From: Brisbane, Australia
Registered: 2010-04-05
Posts: 13
Website

Re: ANSI colorschemes scripts

Offline

#104 2012-01-15 15:30:28

nta
Member
From: Stockholm, Sweden
Registered: 2012-01-14
Posts: 46
Website

Re: ANSI colorschemes scripts

Offline

#105 2012-01-15 16:16:41

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: ANSI colorschemes scripts

PS1="\[\e[01;37m\]┌─[\t]──[\[\e[01;37m\u\e[01;37m\]]──[\[\e[00;37m\]${HOSTNAME%%.*}\[\e[01;37m\]]:\w$\[\e[01;37m\]\n\[\e[01;37m\]└──\[\e[01;37m\]>>\[\e[0m\]"

Last edited by xaos52 (2012-01-15 16:17:20)

Offline

#106 2012-01-15 16:33:19

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: ANSI colorschemes scripts

Last edited by rhowaldt (2012-01-15 16:33:31)

Offline

#107 2012-01-16 22:44:02

a_movingtarget
#! Member
From: the wasteland
Registered: 2011-10-25
Posts: 81

Re: ANSI colorschemes scripts

Coming late to the show here...

Is there a way for me to have one of these (already saved a couple to my ~/bin folder) automatically top my terminator window?  That would be cool...

Offline

#108 2012-04-24 09:10:10

ivo
#! Junkie
From: the six feet under the ground
Registered: 2011-05-06
Posts: 334

Re: ANSI colorschemes scripts

?

Last edited by ivo (2012-06-14 12:56:09)

Offline

#109 2012-06-27 10:34:02

ivo
#! Junkie
From: the six feet under the ground
Registered: 2011-05-06
Posts: 334

Re: ANSI colorschemes scripts

#!/bin/sh
#  
# Autor: Ivo
# 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=""

  redf="${esc}[31m";     greenf="${esc}[32m"
  yellowf="${esc}[33m"   bluef="${esc}[34m";   
  cyanf="${esc}[36m";    purplef="${esc}[35m"   
                      
  boldon="${esc}[1m";    
  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}        ■      ${boldon}${greenf}        ■      ${boldon}${yellowf}        ■     ${boldon}${bluef}         ■       ${boldon}${purplef}       ■      ${boldon}${cyanf}        ■   ${reset}
${boldon}${redf}       ■■■     ${boldon}${greenf}       ■■■     ${boldon}${yellowf}       ■■■    ${boldon}${bluef}        ■■■      ${boldon}${purplef}      ■■■     ${boldon}${cyanf}       ■■■  ${reset}
${boldon}${redf}      ■■■■■    ${boldon}${greenf}      ■■■■■    ${boldon}${yellowf}      ■■■■■   ${boldon}${bluef}       ■■■■■     ${boldon}${purplef}     ■■■■■    ${boldon}${cyanf}      ■■■■■ ${reset}
${redf}     ■(   )■   ${greenf}     ■(   )■   ${yellowf}     ■(   )■   ${bluef}     ■(   )■    ${purplef}    ■(   )■   ${cyanf}     ■(   )■   ${reset}
${redf}    ■■■■ ■■■■  ${greenf}    ■■■■ ■■■■  ${yellowf}    ■■■■ ■■■■  ${bluef}    ■■■■ ■■■■   ${purplef}   ■■■■ ■■■■  ${cyanf}    ■■■■ ■■■■  ${reset}
${redf}   ■■       ■■ ${greenf}   ■■       ■■ ${yellowf}   ■■       ■■ ${bluef}   ■■       ■■  ${purplef}  ■■       ■■ ${cyanf}   ■■       ■■ ${reset}
 
EOF
 

Last edited by ivo (2012-06-27 18:36:35)

Offline

#110 2012-11-11 23:20:02

katsh
#! CrunchBanger
Registered: 2011-12-25
Posts: 153

Re: ANSI colorschemes scripts

#!/bin/bash

XFILE="$HOME/.Xdefaults"

COLS="$(cat $XFILE| grep -Ei urxvt[.*]color[01-9] | sort -n -tr -k2 | cut -d: -f2 | tr -d [:blank:])"

for i in {0..7}; do echo -en "\e[0;3${i}m ▉▉ $(echo "$COLS" | sed -n $(($i+1))'p')\e[0m"; done; echo
for i in {0..7}; do echo -en "\e[0;9${i}m ▉▉ $(echo "$COLS" | sed -n $(($i+9))'p')\e[0m"; done; echo -e "\n"

Last edited by katsh (2012-11-11 23:33:59)

Offline

#111 2012-11-12 17:43:10

Doomicide
#! Junkie
From: the Nightosphere
Registered: 2011-06-24
Posts: 472
Website

Re: ANSI colorschemes scripts

Nice work, I was pretty sure that the regex could've been done better. It worked for me though. Keep 'em coming smile

Offline

#112 2012-11-12 17:47:28

katsh
#! CrunchBanger
Registered: 2011-12-25
Posts: 153

Re: ANSI colorschemes scripts

Offline

#113 2013-02-08 18:25:56

baskerville
Member
Registered: 2011-11-16
Posts: 26
Website

Re: ANSI colorschemes scripts

#! /bin/sh

printf "\033[0m
    \033[49;35m|\033[49;31m|\033[101;31m|\033[41;97m|\033[49;91m|\033[49;93m|\033[0m
  \033[105;35m|\033[45;97m|\033[49;97m||\033[100;97m||\033[49;37m||\033[103;33m|\033[43;97m|\033[0m
  \033[49;95m|\033[49;94m|\033[100;37m||\033[40;97m||\033[40;37m||\033[49;33m|\033[49;32m|\033[0m
  \033[104;34m|\033[44;97m|\033[49;90m||\033[40;39m||\033[49;39m||\033[102;32m|\033[42;97m|\033[0m
    \033[49;34m|\033[49;36m|\033[106;36m|\033[46;97m|\033[49;96m|\033[49;92m|\033[0m

"

Last edited by baskerville (2013-02-13 16:58:59)

Offline

#114 2013-02-08 19:43:36

user77
#! CrunchBanger
From: Dirty Denver
Registered: 2012-01-20
Posts: 161

Re: ANSI colorschemes scripts

^ awesome

Offline

#115 2013-03-14 22:07:55

ed209
Member
Registered: 2012-06-01
Posts: 11

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

 ${redf}■■■■${reset}${boldon}${redf}■■${reset}   ${greenf}■■■■${reset}${boldon}${greenf}■■${reset}   ${yellowf}■■■■${reset}${boldon}${yellowf}■■${reset}   ${bluef}■■■■${reset}${boldon}${purplef}■■${reset}   ${purplef}■■■■${reset}${boldon}${bluef}■■${reset}   ${cyanf}■■■■${reset}${boldon}${cyanf}■■${reset} 
 ${redf}■■${reset}${boldon}${greenf}■■${reset}${boldon}${redf}■■${reset}   ${greenf}■■${reset}${boldon}${yellowf}■■${reset}${boldon}${greenf}■■${reset}   ${yellowf}■■${reset}${boldon}${bluef}■■${reset}${boldon}${yellowf}■■${reset}   ${bluef}■■${reset}${purplef}■■${reset}${boldon}${purplef}■■${reset}   ${purplef}■■${reset}${boldon}${cyanf}■■${reset}${boldon}${bluef}■■${reset}   ${cyanf}■■${reset}${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset} 
 ${greenf}■■${reset}${boldon}${greenf}■■${reset}${boldon}${redf}■■${reset}   ${yellowf}■■${reset}${boldon}${yellowf}■■${reset}${boldon}${greenf}■■${reset}   ${bluef}■■${reset}${boldon}${bluef}■■${reset}${boldon}${yellowf}■■${reset}   ${boldon}${cyanf}■■${reset}${purplef}■■${reset}${boldon}${purplef}■■${reset}   ${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset}${boldon}${bluef}■■${reset}   ${bluef}■■${reset}${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset} 
 ${greenf}■■${reset}${boldon}${greenf}■■${reset}${boldon}${redf}■■${reset}   ${yellowf}■■${reset}${boldon}${yellowf}■■${reset}${boldon}${greenf}■■${reset}   ${bluef}■■${reset}${boldon}${bluef}■■${reset}${boldon}${yellowf}■■${reset}   ${boldon}${cyanf}■■${reset}${purplef}■■${reset}${boldon}${purplef}■■${reset}   ${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset}${boldon}${bluef}■■${reset}   ${bluef}■■${reset}${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset} 
 ${redf}■■■■${reset}${boldon}${redf}■■${reset}   ${greenf}■■■■${reset}${boldon}${greenf}■■${reset}   ${yellowf}■■■■${reset}${boldon}${yellowf}■■${reset}   ${bluef}■■■■${reset}${boldon}${purplef}■■${reset}   ${purplef}■■■■${reset}${boldon}${bluef}■■${reset}   ${cyanf}■■■■${reset}${boldon}${cyanf}■■${reset} 
 ${redf}■■${reset}${boldon}${greenf}■■${reset}${boldon}${redf}■■${reset}   ${greenf}■■${reset}${boldon}${yellowf}■■${reset}${boldon}${greenf}■■${reset}   ${yellowf}■■${reset}${boldon}${bluef}■■${reset}${boldon}${yellowf}■■${reset}   ${bluef}■■${reset}${purplef}■■${reset}${boldon}${purplef}■■${reset}   ${purplef}■■${reset}${boldon}${cyanf}■■${reset}${boldon}${bluef}■■${reset}   ${cyanf}■■${reset}${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset} 
 ${greenf}■■${reset}${boldon}${greenf}■■${reset}${boldon}${redf}■■${reset}   ${yellowf}■■${reset}${boldon}${yellowf}■■${reset}${boldon}${greenf}■■${reset}   ${bluef}■■${reset}${boldon}${bluef}■■${reset}${boldon}${yellowf}■■${reset}   ${boldon}${cyanf}■■${reset}${purplef}■■${reset}${boldon}${purplef}■■${reset}   ${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset}${boldon}${bluef}■■${reset}   ${bluef}■■${reset}${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset} 
 ${greenf}■■${reset}${boldon}${greenf}■■${reset}${boldon}${redf}■■${reset}   ${yellowf}■■${reset}${boldon}${yellowf}■■${reset}${boldon}${greenf}■■${reset}   ${bluef}■■${reset}${boldon}${bluef}■■${reset}${boldon}${yellowf}■■${reset}   ${boldon}${cyanf}■■${reset}${purplef}■■${reset}${boldon}${purplef}■■${reset}   ${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset}${boldon}${bluef}■■${reset}   ${bluef}■■${reset}${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset} 
 ${redf}■■■■${reset}${boldon}${redf}■■${reset}   ${greenf}■■■■${reset}${boldon}${greenf}■■${reset}   ${yellowf}■■■■${reset}${boldon}${yellowf}■■${reset}   ${bluef}■■■■${reset}${boldon}${purplef}■■${reset}   ${purplef}■■■■${reset}${boldon}${bluef}■■${reset}   ${cyanf}■■■■${reset}${boldon}${cyanf}■■${reset} 
 ${redf}■■${reset}${boldon}${greenf}■■${reset}${boldon}${redf}■■${reset}   ${greenf}■■${reset}${boldon}${yellowf}■■${reset}${boldon}${greenf}■■${reset}   ${yellowf}■■${reset}${boldon}${bluef}■■${reset}${boldon}${yellowf}■■${reset}   ${bluef}■■${reset}${purplef}■■${reset}${boldon}${purplef}■■${reset}   ${purplef}■■${reset}${boldon}${cyanf}■■${reset}${boldon}${bluef}■■${reset}   ${cyanf}■■${reset}${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset} 
 ${greenf}■■${reset}${boldon}${greenf}■■${reset}${boldon}${redf}■■${reset}   ${yellowf}■■${reset}${boldon}${yellowf}■■${reset}${boldon}${greenf}■■${reset}   ${bluef}■■${reset}${boldon}${bluef}■■${reset}${boldon}${yellowf}■■${reset}   ${boldon}${cyanf}■■${reset}${purplef}■■${reset}${boldon}${purplef}■■${reset}   ${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset}${boldon}${bluef}■■${reset}   ${bluef}■■${reset}${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset} 
 ${greenf}■■${reset}${boldon}${greenf}■■${reset}${boldon}${redf}■■${reset}   ${yellowf}■■${reset}${boldon}${yellowf}■■${reset}${boldon}${greenf}■■${reset}   ${bluef}■■${reset}${boldon}${bluef}■■${reset}${boldon}${yellowf}■■${reset}   ${boldon}${cyanf}■■${reset}${purplef}■■${reset}${boldon}${purplef}■■${reset}   ${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset}${boldon}${bluef}■■${reset}   ${bluef}■■${reset}${boldon}${purplef}■■${reset}${boldon}${cyanf}■■${reset} 
 
EOF

Offline

#116 2013-03-17 02:25:32

daggoth
Member
From: New Zealand
Registered: 2012-01-18
Posts: 39

Re: ANSI colorschemes scripts

#!/bin/bash

xresrc="$HOME/.Xresources"
normal="$(tput sgr0)"
bold="$(tput bold)"

C=( $( grep -i urxvt[.*]color[0-9]* <"$xresrc" |
       cut -d: -f2                             |
       tr -d [:blank:]                         ) )

V=( $( grep -i urxvt[.*]color[0-9]* <"$xresrc" |
       cut -d: -f1                             |
       tr -d '[a-z-A-Z].*'                     ) )

for i in {0..7..2} ; do
	color="$(tput setaf ${V[$i]})"
	top1+="$color ▉▉▉▉ ${C[$i]} "
	bot1+="$bold$color ▉▉▉▉ ${C[$(($i+1))]} "
done

for i in {8..15..2} ; do
	color="$(tput setaf ${V[$i]})"
	top2+="$color ▉▉▉▉ ${C[$i]} "
	bot2+="$bold$color ▉▉▉▉ ${C[$(($i+1))]} "
done

echo -en "\n$normal$top1\n\n$bot1\n"
echo -e  "\n$normal$top2\n\n$bot2\n$normal"

Last edited by daggoth (2013-03-17 02:29:18)

Offline

#117 2013-06-03 17:24:55

Doomicide
#! Junkie
From: the Nightosphere
Registered: 2011-06-24
Posts: 472
Website

Re: ANSI colorschemes scripts

#!/bin/sh
# Print colorized hexcodes defined in st's config.h
config=~/src/ports/st/config.h
colors=( $(cat $config |\
	sed -n '/static const char \*colorname\[\] = {/,/\[255\] = 0,/p' |\
	sed '{1d; 2d; 12d; $d; /^$/d}' |\
	tr -d [:punct:] |\
	tr -d [:blank:]) )

echo -e " Black    Red      Green    Yellow   Blue     Magenta   Cyan    White   
 ──────────────────────────────────────────────────────────────────────"
for i in {0..7}; do
	echo -en "\e[$((30+$i))m #${colors[$i]} \e[0m"
done
echo
for i in {0..7}; do
	echo -en "\e[1;$((30+$i))m #${colors[$i+8]} \e[0m"
done
echo

Last edited by Doomicide (2013-06-03 18:26:36)

Offline

#118 2013-09-10 06:59:57

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: ANSI colorschemes scripts

#!/bin/bash

#setterm -regtabs 4
COLS="$(xrdb -query| grep -Ei [.*]color[01-9] | sort -n -tr -k2  | tr -d [*[:blank:]])"

for i in {0..7}; do echo -en "\e[0;3${i}m$(echo -e "$COLS" | sed -n $(($i+1))'p' | cut -d ':' -f 1)\e[0m\t"; done; echo
for i in {0..7}; do echo -en "\e[0;3${i}m$(echo -e "$COLS" | sed -n $(($i+1))'p' | cut -d ':' -f 2)\e[0m\t"; done; echo
for i in {0..7}; do echo -en "\e[0;3${i}m▉▉▉▉▉▉▉\t"; done; echo
for i in {0..7}; do echo -en "\e[0;9${i}m$(echo -e "$COLS" | sed -n $(($i+9))'p' | cut -d ':' -f 1)\e[0m\t"; done; echo
for i in {0..7}; do echo -en "\e[0;9${i}m$(echo -e "$COLS" | sed -n $(($i+9))'p' | cut -d ':' -f 2)\e[0m\t"; done; echo
for i in {0..7}; do echo -en "\e[0;9${i}m▉▉▉▉▉▉▉\t"; done; echo -e "\033[0m"
read -p "foreground: ▉▉▉▉▉▉▉ $"

Last edited by ohnonot (2013-09-19 05:32:08)

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: acrobat

Debian Logo