catimg.plugin.zsh 945 B

12345678910111213141516171819
  1. ################################################################################
  2. # catimg script by Eduardo San Martin Morote aka Posva #
  3. # https://posva.net #
  4. # #
  5. # Output the content of an image to the stdout using the 256 colors of the #
  6. # terminal. #
  7. # GitHub: https://github.com/posva/catimg #
  8. ################################################################################
  9. function catimg() {
  10. if (( $+commands[magick] )); then
  11. CONVERT_CMD="magick" zsh $ZSH/plugins/catimg/catimg.sh $@
  12. elif (( $+commands[convert] )); then
  13. CONVERT_CMD="convert" zsh $ZSH/plugins/catimg/catimg.sh $@
  14. else
  15. echo "catimg need magick/convert (ImageMagick) to work)"
  16. fi
  17. }