Created
February 27, 2015 12:37
-
-
Save washtubs/a6cea1bec984fcdb4915 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env zsh | |
| if ! ( which ansi2html &>/dev/null ); then | |
| echo You need to install ansi2html. This is just a convenient wrapper! | |
| echo sudo cpan HTML::FromANSI | |
| exit 1 | |
| fi | |
| local space="" | |
| local cmd="" | |
| for arg in $@; do | |
| cmd="${cmd}${space}${arg}" | |
| space=" " | |
| done | |
| local tmp=$(mktemp 2htmlXXXX) | |
| #-i interactive mode loads your zshrc, and includes aliases | |
| script -qc "$SHELL -ic \"${cmd}\"" > $tmp | |
| ansi2html -f $tmp > $HOME/.2html.html | |
| sed -i -e 's/black/white/g' $HOME/.2html.html | |
| google-chrome-stable $HOME/.2html.html | |
| #xdg-open $HOME/.2html.html | |
| rm $tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment