Class: Echoes::Configuration
- Inherits:
-
Object
- Object
- Echoes::Configuration
- Defined in:
- lib/echoes/configuration.rb
Instance Method Summary collapse
- #active_pane_border_color(*args) ⇒ Object
- #background(*args) ⇒ Object
- #color_palette(val = nil) ⇒ Object
- #cols(val = nil) ⇒ Object
- #copy_mode_cursor_color(*args) ⇒ Object
- #cursor_color(*args) ⇒ Object
- #font_family(val = nil) ⇒ Object
- #font_size(val = nil) ⇒ Object
- #foreground(*args) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #pane_divider_color(*args) ⇒ Object
- #rows(val = nil) ⇒ Object
- #scrollback_limit(val = nil) ⇒ Object
- #selection_color(*args) ⇒ Object
- #shell(val = nil) ⇒ Object
- #tab_position(val = nil) ⇒ Object
- #term(val = nil) ⇒ Object
- #window_title(val = nil) ⇒ Object
- #word_separators(val = nil) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/echoes/configuration.rb', line 5 def initialize @font_size = 14.0 @rows = 24 @cols = 80 @shell = ENV['SHELL'] || '/bin/bash' @scrollback_limit = 1000 @foreground = [0.9, 0.9, 0.9] @background = [0.0, 0.0, 0.0] @cursor_color = [0.7, 0.7, 0.7, 0.5] @font_family = nil @window_title = 'Echoes' @tab_position = :top @color_palette = nil @term = 'xterm-256color' @word_separators = ' @*.:/\\()"\'-:,.;<>~!#$%^&*|+=[]{}~?│' @selection_color = [0.2, 0.4, 0.7] @pane_divider_color = [0.4, 0.4, 0.4] @active_pane_border_color = [0.3, 0.5, 0.8] @copy_mode_cursor_color = [0.8, 0.7, 0.2] end |
Instance Method Details
#active_pane_border_color(*args) ⇒ Object
86 87 88 |
# File 'lib/echoes/configuration.rb', line 86 def active_pane_border_color(*args) args.empty? ? @active_pane_border_color : @active_pane_border_color = parse_color(args) end |
#background(*args) ⇒ Object
54 55 56 |
# File 'lib/echoes/configuration.rb', line 54 def background(*args) args.empty? ? @background : @background = parse_color(args) end |
#color_palette(val = nil) ⇒ Object
94 95 96 97 98 99 100 |
# File 'lib/echoes/configuration.rb', line 94 def color_palette(val = nil) if val @color_palette = val.map { |c| c.is_a?(String) ? parse_color([c]) : c.map(&:to_f) } else @color_palette end end |
#cols(val = nil) ⇒ Object
38 39 40 |
# File 'lib/echoes/configuration.rb', line 38 def cols(val = nil) val ? @cols = val.to_i : @cols end |
#copy_mode_cursor_color(*args) ⇒ Object
90 91 92 |
# File 'lib/echoes/configuration.rb', line 90 def copy_mode_cursor_color(*args) args.empty? ? @copy_mode_cursor_color : @copy_mode_cursor_color = parse_color(args) end |
#cursor_color(*args) ⇒ Object
58 59 60 |
# File 'lib/echoes/configuration.rb', line 58 def cursor_color(*args) args.empty? ? @cursor_color : @cursor_color = parse_color(args) end |
#font_family(val = nil) ⇒ Object
26 27 28 |
# File 'lib/echoes/configuration.rb', line 26 def font_family(val = nil) val ? @font_family = val : @font_family end |
#font_size(val = nil) ⇒ Object
30 31 32 |
# File 'lib/echoes/configuration.rb', line 30 def font_size(val = nil) val ? @font_size = val.to_f : @font_size end |
#foreground(*args) ⇒ Object
50 51 52 |
# File 'lib/echoes/configuration.rb', line 50 def foreground(*args) args.empty? ? @foreground : @foreground = parse_color(args) end |
#pane_divider_color(*args) ⇒ Object
82 83 84 |
# File 'lib/echoes/configuration.rb', line 82 def pane_divider_color(*args) args.empty? ? @pane_divider_color : @pane_divider_color = parse_color(args) end |
#rows(val = nil) ⇒ Object
34 35 36 |
# File 'lib/echoes/configuration.rb', line 34 def rows(val = nil) val ? @rows = val.to_i : @rows end |
#scrollback_limit(val = nil) ⇒ Object
46 47 48 |
# File 'lib/echoes/configuration.rb', line 46 def scrollback_limit(val = nil) val ? @scrollback_limit = val.to_i : @scrollback_limit end |
#selection_color(*args) ⇒ Object
78 79 80 |
# File 'lib/echoes/configuration.rb', line 78 def selection_color(*args) args.empty? ? @selection_color : @selection_color = parse_color(args) end |
#shell(val = nil) ⇒ Object
42 43 44 |
# File 'lib/echoes/configuration.rb', line 42 def shell(val = nil) val ? @shell = val : @shell end |
#tab_position(val = nil) ⇒ Object
66 67 68 |
# File 'lib/echoes/configuration.rb', line 66 def tab_position(val = nil) val ? @tab_position = val.to_sym : @tab_position end |
#term(val = nil) ⇒ Object
70 71 72 |
# File 'lib/echoes/configuration.rb', line 70 def term(val = nil) val ? @term = val : @term end |
#window_title(val = nil) ⇒ Object
62 63 64 |
# File 'lib/echoes/configuration.rb', line 62 def window_title(val = nil) val ? @window_title = val : @window_title end |
#word_separators(val = nil) ⇒ Object
74 75 76 |
# File 'lib/echoes/configuration.rb', line 74 def word_separators(val = nil) val ? @word_separators = val : @word_separators end |