Skip to content
This repository

Add option for tmux message foreground color #347

Merged
merged 1 commit into from over 1 year ago

2 participants

Eric Boehs Michael Kessler
Eric Boehs

Currently it uses whatever tmux's default foreground color is set to. For someone using the tmux solarized theme this is orange. A failure background of bright red with orange text is almost impossible to read.

I've added an option to set the foreground color defaulting it to white.

Michael Kessler netzpirat merged commit 69e9d29 into from
Michael Kessler
Owner

Thanks for the pull request. I've changed it to support a different foreground color per message type, as it's the same with the foreground color. Also the missing specs have been added.

Eric Boehs
Michael Kessler
Owner

I like to release a new Guard version this week, I just need some feedback on #327, as it seems to work fine and is ready to merge.

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

Showing 1 unique commit by 1 author.

Oct 20, 2012
Eric Boehs ericboehs Add option for tmux message foreground 69e9d29
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. +3 0  lib/guard/notifiers/tmux.rb
3  lib/guard/notifiers/tmux.rb
@@ -25,6 +25,7 @@ module Tmux
25 25 :timeout => 5,
26 26 :display_message => false,
27 27 :default_message_format => '%s - %s',
  28 + :default_message_color => 'white',
28 29 :line_separator => ' - ',
29 30 :color_location => 'status-left-bg'
30 31 }
@@ -74,6 +75,7 @@ def notify(type, title, message, image, options = { })
74 75 #
75 76 def display_message(type, title, message, options = { })
76 77 message_format = options["#{ type }_message_format".to_sym] || options[:default_message_format] || DEFAULTS[:default_message_format]
  78 + message_color = options[:default_message_color] || DEFAULTS[:default_message_color]
77 79 display_time = options[:timeout] || DEFAULTS[:timeout]
78 80 separator = options[:line_separator] || DEFAULTS[:line_separator]
79 81
@@ -82,6 +84,7 @@ def display_message(type, title, message, options = { })
82 84 display_message = message_format % [title, formatted_message]
83 85
84 86 system("#{ DEFAULTS[:client] } set display-time #{ display_time * 1000 }")
  87 + system("#{ DEFAULTS[:client] } set message-fg #{ message_color }")
85 88 system("#{ DEFAULTS[:client] } set message-bg #{ color }")
86 89 system("#{ DEFAULTS[:client] } display-message '#{ display_message }'")
87 90 end

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.