Class: TopinambourTerminal

Inherits:
Vte::Terminal
  • Object
show all
Defined in:
lib/terminal.rb

Overview

The default vte terminal customized

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command_string, working_dir = nil) ⇒ TopinambourTerminal

Create a new TopinambourTerminal instance that runs command_string



41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/terminal.rb', line 41

def initialize(command_string, working_dir = nil)
  super()
  set_name("topinambour-terminal")
  command_array = parse_command(command_string)
  rescued_spawn(command_array, working_dir)

  signal_connect "child-exited" do |widget|
    toplevel.application.quit
  end

  add_popup_menu
  configure
end

Instance Attribute Details

#last_matchObject (readonly)

Returns the value of attribute last_match.



37
38
39
# File 'lib/terminal.rb', line 37

def last_match
  @last_match
end

Returns the value of attribute menu.



37
38
39
# File 'lib/terminal.rb', line 37

def menu
  @menu
end

#pidObject (readonly)

Returns the value of attribute pid.



37
38
39
# File 'lib/terminal.rb', line 37

def pid
  @pid
end

#regexesObject (readonly)

Returns the value of attribute regexes.



37
38
39
# File 'lib/terminal.rb', line 37

def regexes
  @regexes
end

Instance Method Details

#colorsObject



69
70
71
72
73
# File 'lib/terminal.rb', line 69

def colors
  colors_strings = toplevel.application.settings["colorscheme"]
  @colors = colors_strings.map { |c| Gdk::RGBA.parse(c) }
  @colors
end

#colors=(colors) ⇒ Object



80
81
82
# File 'lib/terminal.rb', line 80

def colors=(colors)
  set_colors(colors[0], colors[1], colors[2..-1])
end

#fontObject



75
76
77
78
# File 'lib/terminal.rb', line 75

def font
  font_str = toplevel.application.settings["font"]
  @font = Pango::FontDescription.new(font_str)
end

#font=(font_str) ⇒ Object



84
85
86
87
88
89
# File 'lib/terminal.rb', line 84

def font=(font_str)
  toplevel.application.settings["font"] = font_str
  font = Pango::FontDescription.new(font_str)
  set_font(font)
  @font = font
end

#load_settingsObject



63
64
65
66
67
# File 'lib/terminal.rb', line 63

def load_settings
  colors
  set_colors(@colors[0], @colors[1], @colors[2..-1])
  set_font(font)
end

#pid_dirObject



55
56
57
# File 'lib/terminal.rb', line 55

def pid_dir
  File.readlink("/proc/#{@pid}/cwd")
end

#terminal_titleObject



59
60
61
# File 'lib/terminal.rb', line 59

def terminal_title
  @custom_title.class == String ? @custom_title : window_title.to_s
end