Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I have a little ruby script that pings our CI server and returns a :-) or a :-( based on if the build is passing or failing.

Now, what I'd like to do is make it red if it's a fail and green if it's passing. Can you evaluate the result of the script and set a differnet color based on that?

The status line from my tmux_conf:

set-option -g status-right #[default]Build:
  #(ruby ~/tmux_scripts/scripts/ci.rb) #[fg=green]#H#[default] %m/%d/%y %I:%M'
share|improve this question
up vote 1 down vote accepted

I do not think this is documented—or even whether it is intentional functionality—but the attribute processing is done after the #() output is substituted, so your program can include its own bits of attribute syntax in its output.

To get the effect you want, have your Ruby program generate an output line similar to this:


or this:

share|improve this answer
That did it, thank you! – DVG Sep 13 '13 at 11:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.