Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

colours: tidy up text

  • Loading branch information...
commit 0249104eaefe9f482d8350d7b1c1c2758ee86b76 1 parent bbf05ae
@w0ng authored
Showing with 14 additions and 14 deletions.
  1. +14 −14 colours
View
28 colours
@@ -5,30 +5,30 @@
# Prints terminal colour scheme information
# Usage: ./colours [-v]
-colur_hexes=($(xrdb -query | sed -n 's/.*color\([0-9]\)/\1/p' | sort -nu | cut -f2))
-colour_names=(black red green yellow blue magenta cyan white)
+hexes=($(xrdb -query | sed -n 's/.*color\([0-9]\)/\1/p' | sort -nu | cut -f2))
+names=(black red green yellow blue magenta cyan white)
# add -v argument for verbose output
if [[ $# -eq 1 && $1 == "-v" ]]; then
- printf "┌────────────────────────────────────────────────────┐\n"
- printf "preview name bash urxvt hex │\n"
- printf "├────────────────────────────────────────────────────┤\n"
+ printf "┌────────────────────────────────────────────────────────┐\n"
+ printf "Preview Name Bash Urxvt Hex │\n"
+ printf "├────────────────────────────────────────────────────────┤\n"
for i in {0..7}
do
- printf "%-30b" "│\e[0;$((30+$i))m ████████ $colour_names[i+1]"
+ printf "%-35b" "│\e[0;$((30+$i))m ████████ $names[i+1]"
printf %s "\e[0;$((30+$i))m "
- printf "%-11b" "colors$i"
- printf "$colur_hexes[i+1]\e[0m │\n"
+ printf "%-10b" "color$i"
+ printf "$hexes[i+1]\e[0m │\n"
- printf "%-30b" "│\e[1;$((30+$i))m ████████ $colour_names[i+1]"
+ printf "%-35b" "│\e[1;$((30+$i))m ████████ bold $names[i+1]"
printf %s "\e[1;$((30+$i))m "
- printf "%-11b" "colors$((i+8))"
- printf "$colur_hexes[i+9]\e[0m │\n"
+ printf "%-10b" "color$((i+8))"
+ printf "$hexes[i+9]\e[0m │\n"
done
- printf "└────────────────────────────────────────────────────┘\n"
+ printf "└────────────────────────────────────────────────────────┘\n"
else
printf "\e[1;37m BLK RED GRN YEL BLU MAG CYN WHT\n"
printf "────────────────────────────────────────────────────────────────────────────────────────\e[0m\n"
- for i in {0..7}; printf "\e[$((30+$i))m █ $colur_hexes[i+1] \e[0m"; printf "\n"
- for i in {8..15}; printf "\e[1;$((22+$i))m █ $colur_hexes[i+1] \e[0m"; printf "\n"
+ for i in {0..7}; printf "\e[$((30+$i))m █ $hexes[i+1] \e[0m"; printf "\n"
+ for i in {8..15}; printf "\e[1;$((22+$i))m █ $hexes[i+1] \e[0m"; printf "\n"
fi
Please sign in to comment.
Something went wrong with that request. Please try again.