Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use it? #1

Open
smith opened this issue Apr 18, 2011 · 7 comments
Open

How do I use it? #1

smith opened this issue Apr 18, 2011 · 7 comments

Comments

@smith
Copy link

smith commented Apr 18, 2011

brew installed libcaca. Still can't figure out how to make it work. Could you explain on the README or am I missing something obvious?

@jrunning
Copy link
Owner

Yeah I know I should write out some instructions. Basic steps:

  1. Run img2txt -v to make sure it's working.
  2. Make sure the script is executable (e.g. chmod a+x piano-ascii-art.sh).
  3. Edit ~/.config/pianobar/config and put the full path to piano-ascii-art.sh for the event_cmd= option, e.g.:
event_command = /home/your_username/.config/pianobar/piano-ascii-art.sh

Let me know if it still doesn't work.

@smith
Copy link
Author

smith commented Apr 18, 2011

Closer. How do I use multiple event_commands? (didn't RTFM). I want to use growl and this. img2txt is working by itself I think but I'm getting:

img2txt: unable to load *

This is important. I need this for my business.

@jrunning
Copy link
Owner

pianobar doesn't have built-in support for multiple eventcmd scripts. I use a bash script that just sends the output to every executable file in a directory, which works pretty well actually:

#!/bin/bash

DIR=$(cd `dirname $0` && pwd) # Where this script lives

output=`cat /dev/stdin`

for SCRIPT in $(find $DIR/eventcmd/ -not \( -type d -name ".?*" -prune \) -type f); do
  if [ -f $SCRIPT -a -x $SCRIPT ]; then
    echo -e "$output" | $SCRIPT $@
  fi
done

As for the error, I'm not sure how to fix it. It has to do with the (very dumb) way it downloads images into a hardcoded directory before and then passes * as the filename to img2txt. I'm intending to replace that method with something less dumb in the near future--in the immediate term, however, you may have to just eyeball the source and see if you can figure out a solution.

@smith
Copy link
Author

smith commented Apr 18, 2011

Looks like the homebrew default install for libcaca compiles with --disable-imlib2, which means it only works with BMP files. Trying to get that figured out. Where did your caca come from?

@jrunning
Copy link
Owner

Ohhhh yeah, I forgot about that. I had the same problem. I think I installed imlib2 with homebrew (brew install imlib2), then built my caca from source, which you can download here.

EDIT: You can modify the compile flags with brew edit libcaca and just delete that --disable-imlib2 flag. After that you should be able to do brew install imlib2 libcaca for great justice.

I have no idea why the brew recipe has that --disable-imlib2 flag.

@avit
Copy link

avit commented Mar 8, 2014

For anyone else who lands here having problems with brew's libcaca installation on Mac OS X, you now need this:

brew install libcaca --with-imlib2

@ment4t
Copy link

ment4t commented Jun 7, 2014

Had issue with ranger not rendering ASCII previews (using img2txt). Reinstalled libcaca following avit's comment above resolved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants