Skip to content

Commit

Permalink
Change tmux status bar to status-left-bg
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy van de Water authored and Integrum User committed Sep 26, 2012
1 parent 06cd247 commit bd213c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source :rubygems
gemspec

gem 'rake'
gem 'listen', :github => 'guard/listen'
gem 'listen', :git => 'http://github.com/guard/listen.git' #:github => 'guard/listen'

# The development group will no be
# installed on Travis CI.
Expand Down
2 changes: 1 addition & 1 deletion lib/guard/notifiers/tmux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def available?(silent = false)
#
def notify(type, title, message, image, options = { })
color = tmux_color type, options
system("#{DEFAULTS[:client]} set-window-option -g window-status-current-bg #{color}")
system("#{DEFAULTS[:client]} set -g status-left-bg #{color}")
end

# Get the Tmux color for the notification type.
Expand Down
10 changes: 5 additions & 5 deletions spec/guard/notifiers/tmux_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,31 @@ def self.show(options) end

describe '.notify' do
it 'should set the tmux status bar color to green on success' do
subject.should_receive(:system).with "tmux set-window-option -g window-status-current-bg green"
subject.should_receive(:system).with "tmux set -g status-left-bg green"

subject.notify('success', 'any title', 'any message', 'any image', { })
end

it 'should set the tmux status bar color to black on success when black is passed in as an option' do
subject.should_receive(:system).with "tmux set-window-option -g window-status-current-bg black"
subject.should_receive(:system).with "tmux set -g status-left-bg black"

subject.notify('success', 'any title', 'any message', 'any image', { :success => 'black' })
end

it 'should set the tmux status bar color to red on failure' do
subject.should_receive(:system).with "tmux set-window-option -g window-status-current-bg red"
subject.should_receive(:system).with "tmux set -g status-left-bg red"

subject.notify('failed', 'any title', 'any message', 'any image', { })
end

it 'should set the tmux status bar color to green on pending' do
subject.should_receive(:system).with "tmux set-window-option -g window-status-current-bg green"
subject.should_receive(:system).with "tmux set -g status-left-bg green"

subject.notify('pending', 'any title', 'any message', 'any image', { })
end

it 'should set the tmux status bar color to green on notify' do
subject.should_receive(:system).with "tmux set-window-option -g window-status-current-bg green"
subject.should_receive(:system).with "tmux set -g status-left-bg green"

subject.notify('notify', 'any title', 'any message', 'any image', { })
end
Expand Down

0 comments on commit bd213c8

Please sign in to comment.