Skip to content

Commit

Permalink
ansi color codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcool committed Apr 10, 2012
1 parent 8dd9d40 commit 203c986
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ansi_colors.sh
@@ -0,0 +1,9 @@
#!/bin/bash

ANSI_COLORS="$(xrdb -query | grep -Ei urxvt[.*]color[01-9] | sort -n -tr -k2 | cut -d: -f2 | tr -d '[:blank:]')"

echo "BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE"
for i in {0..7}; do printf '%b' "\e[0;3${i}m $(echo "$ANSI_COLORS" | sed -n $(($i+1))'p')\e[0m "; done;
echo
for i in {0..7}; do printf '%b' "\e[0;9${i}m $(echo "$ANSI_COLORS" | sed -n $(($i+9))'p')\e[0m "; done;
echo

0 comments on commit 203c986

Please sign in to comment.