Add rename-session

This commit is contained in:
Samuel Garneau 2011-02-17 22:12:39 -05:00
parent 34c7ec5649
commit fc738ad9cc
2 changed files with 20 additions and 11 deletions

View File

@ -14,6 +14,8 @@ Teamocil is a tool used to automatically create windows and splits in `tmux` wit
# ~/.teamocil/sample.yml # ~/.teamocil/sample.yml
session:
name: sample-session
windows: windows:
- name: sample-window - name: sample-window
splits: splits:

View File

@ -16,7 +16,14 @@ module Teamocil
def generate_commands # {{{ def generate_commands # {{{
output = [] output = []
@layout["windows"].each_with_index do |window, window_index| if @layout["session"].nil?
windows = @layout["windows"]
else
output << "tmux rename-session #{@layout["session"]["name"]}"
windows = @layout["session"]["windows"]
end
windows.each_with_index do |window, window_index|
if options.include?(:here) and window_index == 0 if options.include?(:here) and window_index == 0
output << "tmux rename-window #{window["name"]}" output << "tmux rename-window #{window["name"]}"