Created
July 3, 2017 11:10
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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