Skip to content

Instantly share code, notes, and snippets.

@bohoomil
Created December 1, 2012 13:07
Show Gist options
  • Save bohoomil/4182181 to your computer and use it in GitHub Desktop.
Save bohoomil/4182181 to your computer and use it in GitHub Desktop.
show Xresources colours
#!/bin/sh
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