mailcount.sh aborting on os x #132

Closed
pcragone opened this Issue Feb 2, 2013 · 4 comments

Comments

Projects
None yet
2 participants

pcragone commented Feb 2, 2013

fresh os x 10.8 install here - set up everything all nice and neat, but mailcount.sh is apparently failing. i can't quite find where it's failing:

pragone@zagyva:~  ○ bash -x .tmux/tmux-powerline/segments/mailcount.sh               
+ TMUX_POWERLINE_SEG_MAILCOUNT_MAILDIR_INBOX_DEFAULT=/Users/pragone/.mail/inbox/new
+ TMUX_POWERLINE_SEG_MAILCOUNT_MBOX_INBOX_DEFAULT=
+ TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_SERVER_DEFAULT=gmail.com
+ TMUX_POWERLINE_SEG_MAILCOUNT_GMAIL_INTERVAL_DEFAULT=5

So maybe it was the apple mail script?

pragone@zagyva:~  ○ bash -x .tmux/tmux-powerline/segments/mailcount_apple_mail.script 
+ tell application 'System Events'
.tmux/tmux-powerline/segments/mailcount_apple_mail.script: line 4: tell: command not found
.tmux/tmux-powerline/segments/mailcount_apple_mail.script: line 5: syntax error near unexpected token `('
.tmux/tmux-powerline/segments/mailcount_apple_mail.script: line 5: `    set process_list to (name of every process)'

Well that makes sense. That's applescript, if i understand correctly. So what if we just execute it straight up, since it's got a nice bang line on it?

pragone@zagyva:~  ○ .tmux/tmux-powerline/segments/mailcount_apple_mail.script 
dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/osascript) is code signed with entitlements
pragone@zagyva:~  ○ 

Let me know what else you need to help debug this.

Owner

erikw commented Feb 2, 2013

I don't have access to a 10.8 system atm but it seems to be a known problem described e.g. here https://discussions.apple.com/thread/4169375?start=0&tstart=0

Does other osascripts work?

pcragone commented Feb 2, 2013

Let me take a look; in the meantime, I've discovered that now_playing fails as wells, seemingly for the same reason: it's not picking up a variable that gets set.

For mailcount.sh, I have line 12 read:
export TMUX_POWERLINE_SEG_MAILCOUNT_MAILBOX_TYPE="apple_mail"
But it's exiting on line 63:

if [ -z "$TMUX_POWERLINE_SEG_MAILCOUNT_MAILBOX_TYPE" ]; then
  return 2
fi

Same for now_playing, with the TMUX_POWERLINE_SEG_NOW_PLAYING_MUSIC_PLAYER variable.

Owner

erikw commented Feb 3, 2013

Your not supposed to edit line 12 to set the variable. Changing line12 changes what will be outputted with generate_rc.sh. Run that script and make changes in ~/.tmux-powerlinerc.

pcragone commented Feb 3, 2013

Ahh. It all makes more sense now. I was working with having played with the version of tmux-powerline from a few months ago. Thanks

@pcragone pcragone closed this Feb 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment