Skip to content

Instantly share code, notes, and snippets.

@dom111
Created July 3, 2017 11:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dom111/f18f95dfcdff16eae901f69bb49d2f32 to your computer and use it in GitHub Desktop.
#!/bin/bash
tput sc;
# ASCII table style:
# perl -nle "\$c=$(tput cols);"'push@F,$_}{$M=$c-($c/4);$L=(sort{$b-$a}map{y///c}@F)[0];$L=($L,$M)[$L>$M];print map{$i=$c-($L+3);$-++;"\x1b[$-;${i}f$_\n"}($s="+"."-"x($L+2)."+"),(map{"|".sprintf(" %-$L.${L}s ",$_)."|"}@F),$s' < ~/TODO;
# coloured
background=44;
foreground=97;
perl -nle "\$c=$(tput cols);\$b=$background;\$f=$foreground;"'push@F,$_}{$M=$c-($c/4);$L=(sort{$b-$a}map{y///c}@F)[0];$L=($L,$M)[$L>$M];print map{$i=$c-($L+5);$-++;"\x1b[$-;${i}f\x1b[$b;${f}m".sprintf(" %-$L.${L}s ",$_)}"",@F,""' < ~/TODO;
tput rc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment