Class: XfceTerminal

Inherits:
Object
  • Object
show all
Defined in:
lib/hilfer/xfce_terminal.rb

Overview

Knows how to lauch XFCE Terminal with mutiple tabs, each opened on a different directory

Instance Method Summary collapse

Instance Method Details

#launch(dirs) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/hilfer/xfce_terminal.rb', line 11

def launch( dirs )
  # construct arguments and launch
  # Terminal --working-directory ~/projects --tab --working-directory /projects/bin
  args = [ 'Terminal' ]
  dirs.uniq.each do |x|
    # first one will be a window so no arg needed, subsequent ones are tabs
    args << '--tab' if args.size > 1
    args << "--working-directory"
    args << x
  end
  puts "args: #{args.inspect}"
  system( *args )
end