module Teamocil::Tmux

Public Class Methods

option(option, default: nil) click to toggle source
# File lib/teamocil/tmux.rb, line 3
def self.option(option, default: nil)
  command = Teamocil::Command::ShowOptions.new(name: option)
  value = Teamocil.query_system(command).chomp
  value.empty? ? default : value.to_i
end
pane_count(index: nil) click to toggle source
# File lib/teamocil/tmux.rb, line 20
def self.pane_count(index: nil)
  command = Teamocil::Command::ListPanes.new(index: index)
  Teamocil.query_system(command).chomp.split("\n").size
end
window_count() click to toggle source
# File lib/teamocil/tmux.rb, line 15
def self.window_count
  command = Teamocil::Command::ListWindows.new
  Teamocil.query_system(command).chomp.split("\n").size
end
window_option(option, default: nil) click to toggle source
# File lib/teamocil/tmux.rb, line 9
def self.window_option(option, default: nil)
  command = Teamocil::Command::ShowWindowOptions.new(name: option)
  value = Teamocil.query_system(command).chomp
  value.empty? ? default : value.to_i
end