Class: Tmuxall::Layouts::TwoColumns

Inherits:
Base
  • Object
show all
Defined in:
lib/tmuxall/layouts/two_columns.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #run

Constructor Details

This class inherits a constructor from Tmuxall::Layouts::Base

Instance Method Details

#create_panesObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tmuxall/layouts/two_columns.rb', line 7

def create_panes
  (1..(@panes_count - 2)).step(2).each do |n|
    tmux "splitw"
    tmux "selectl even-vertical"
  end

  if @panes_count > 1
    (1...@panes_count).step(2).each do |n|
      tmux "selectp -t #{n}"
      tmux "splitw -h"
    end
  end
end

#run_commands_in_panesObject



21
22
23
24
25
26
# File 'lib/tmuxall/layouts/two_columns.rb', line 21

def run_commands_in_panes
  (1..@panes_count).each do |n|
    tmux "selectp -t #{n}"
    tmux %Q{send-keys "#{@commands[n - 1]}\n"}
  end
end