Useful CLI tools (bash) for Arch Linux administration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
440 B

5 years ago
5 years ago
5 years ago
  1. #!/usr/bin/env bash
  2. # tputcolors - Display shell colors
  3. # Author: user79743
  4. # Source: https://unix.stackexchange.com/questions/269077/tput-setaf-color-table-how-to-determine-color-codes
  5. #####################################
  6. color(){
  7. for c; do
  8. printf '\e[48;5;%dm%03d' $c $c
  9. done
  10. printf '\e[0m \n'
  11. }
  12. IFS=$' \t\n'
  13. color {0..15}
  14. for ((i=0;i<6;i++)); do
  15. color $(seq $((i*36+16)) $((i*36+51)))
  16. done
  17. color {232..255}