Ithika (brokenhut) wrote in ljcharm,

  • Mood:

Wrapper script for even easier posting

I'm using charm at the moment inside a little wrapper script (in Bash) I have which pipes my files through Markdown and SmartyPants for lovely formatting, etc. I just installed MPD/MPC as my music player and wanted to add that to the mix when I post.

Unfortunately, all my attempts end up with Current music: "Godspeed when it should really say Current music: Godspeed You Black Emperor!: Monheim, or some such. I've done a lot of fiddling with different placements of " and ' and without either, but nothing seems to work.

Currently, the little bit of code which does the business looks like this:

    # Insert current track, if playing
    if [[ $(mpc status | grep playing) ]];
        MUSIC="--music "$(mpc status --format '%artist%: %title%' | head -n 1 )""
    charm -q -s "$SUBJ" "$MUSIC" $@ <<< "$BODY"

Can anyone suggest why this wouldn't work? If I remove the $MUSIC reference from the charm argument string it all works as planned, but I'd really like it to do music too.

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your IP address will be recorded