aboutsummaryrefslogtreecommitdiffstats
path: root/bin/colcol
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-09-03 19:42:34 +0000
committerterminaldweller <thabogre@gmail.com>2021-09-03 19:42:34 +0000
commit2595c133eea2ffc7e3fd40b555f1364305125af1 (patch)
tree651d0094c36c97164e3c2036f1299c2c04c7cbe5 /bin/colcol
parentzsh overhaul (diff)
downloadscripts-2595c133eea2ffc7e3fd40b555f1364305125af1.tar.gz
scripts-2595c133eea2ffc7e3fd40b555f1364305125af1.zip
removed path from tmux, added short path to shell prompt. removed exa, using ls again. no more htop, using top now.
Diffstat (limited to '')
-rwxr-xr-xbin/colcol36
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/colcol b/bin/colcol
new file mode 100755
index 0000000..bb1eb61
--- /dev/null
+++ b/bin/colcol
@@ -0,0 +1,36 @@
+#!/usr/bin/gawk -f
+#colorizes a columnar output
+BEGIN {
+ colors[1] = "\x1b[38;5;216m"
+ colors[2] = "\x1b[38;5;192m"
+ colors[3] = "\x1b[38;5;22m"
+ colors[4] = "\x1b[38;5;25m"
+ colors[5] = "\x1b[38;5;98m"
+ colors[6] = "\x1b[38;5;68m"
+ colors[7] = "\x1b[38;5;59m"
+ colors[8] = "\x1b[38;5;36m"
+ colors[9] = "\x1b[38;5;202m"
+ colors[10] = "\x1b[38;5;100m"
+ colors[11] = "\x1b[38;5;105m"
+ colors[12] = "\x1b[38;5;106m"
+ colors[13] = "\x1b[38;5;96m"
+ colors[14] = "\x1b[38;5;31m"
+ colors[15] = "\x1b[38;5;23m"
+ colors[16] = "\x1b[38;5;105m"
+ colors_len=16
+}
+{
+ if (1 == NR){
+ max_col = NF
+ }
+ # printf max_col" "
+ printf NR-1" "
+ for (i = 1; i <= NF; i++){
+ if (i >= colors_len) {
+ printf "",colors[colors_len]$i" "
+ } else {
+ printf colors[i]$i" "
+ }
+ }
+ print "\033[0m"
+}