Permalink
Browse files

ansi color codes

  • Loading branch information...
Gcool committed Apr 10, 2012
1 parent 8dd9d40 commit 203c986006fb3766dbb165319f190a31a7977666
Showing with 9 additions and 0 deletions.
  1. +9 −0 ansi_colors.sh
View
@@ -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.