Class: TopinambourTerminal
- Inherits:
-
Vte::Terminal
- Object
- Vte::Terminal
- TopinambourTerminal
- Defined in:
- lib/terminal.rb
Overview
The default vte terminal customized
Instance Attribute Summary collapse
-
#last_match ⇒ Object
readonly
Returns the value of attribute last_match.
-
#menu ⇒ Object
readonly
Returns the value of attribute menu.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#regexes ⇒ Object
readonly
Returns the value of attribute regexes.
Instance Method Summary collapse
- #colors ⇒ Object
- #colors=(colors) ⇒ Object
- #font ⇒ Object
- #font=(font_str) ⇒ Object
-
#initialize(command_string, working_dir = nil) ⇒ TopinambourTerminal
constructor
Create a new TopinambourTerminal instance that runs command_string.
- #load_settings ⇒ Object
- #pid_dir ⇒ Object
- #terminal_title ⇒ Object
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 || toplevel.application.quit end configure end |
Instance Attribute Details
#last_match ⇒ Object (readonly)
Returns the value of attribute last_match.
37 38 39 |
# File 'lib/terminal.rb', line 37 def last_match @last_match end |
#menu ⇒ Object (readonly)
Returns the value of attribute menu.
37 38 39 |
# File 'lib/terminal.rb', line 37 def @menu end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
37 38 39 |
# File 'lib/terminal.rb', line 37 def pid @pid end |
#regexes ⇒ Object (readonly)
Returns the value of attribute regexes.
37 38 39 |
# File 'lib/terminal.rb', line 37 def regexes @regexes end |
Instance Method Details
#colors ⇒ Object
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 |
#font ⇒ Object
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_settings ⇒ Object
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_dir ⇒ Object
55 56 57 |
# File 'lib/terminal.rb', line 55 def pid_dir File.readlink("/proc/#{@pid}/cwd") end |
#terminal_title ⇒ Object
59 60 61 |
# File 'lib/terminal.rb', line 59 def terminal_title @custom_title.class == String ? @custom_title : window_title.to_s end |