Skip to content

Instantly share code, notes, and snippets.

@jcyamo
Created June 23, 2013 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jcyamo/5843658 to your computer and use it in GitHub Desktop.
Save jcyamo/5843658 to your computer and use it in GitHub Desktop.
Script for echoing hex values of current term colors
#!/bin/bash
colors=($(xrdb -query | sed -n 's/.*color\([0-9]\)/\1/p' | sort -nu | cut -f2))
echo -e "\e[1;37m
Black Red Green Yellow Blue Magenta Cyan White
──────────────────────────────────────────────────────────────────────\e[0m"
for i in {0..7}; do echo -en "\e[$((30+$i))m ${colors[i]} \e[0m"; done
echo
for i in {8..15}; do echo -en "\e[1;$((22+$i))m ${colors[i]} \e[0m"; done
echo -e "\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment