Skip to content

Instantly share code, notes, and snippets.

@kmatt
Forked from bohoomil/colors
Created June 14, 2020 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmatt/c794cc07a4f5661565e0b697e98ef34b to your computer and use it in GitHub Desktop.
Save kmatt/c794cc07a4f5661565e0b697e98ef34b 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