Add rename-session
This commit is contained in:
parent
34c7ec5649
commit
fc738ad9cc
22
README.mkd
22
README.mkd
@ -14,16 +14,18 @@ Teamocil is a tool used to automatically create windows and splits in `tmux` wit
|
||||
|
||||
# ~/.teamocil/sample.yml
|
||||
|
||||
windows:
|
||||
- name: sample-window
|
||||
splits:
|
||||
- cmd: cd ~/Code/sample/www
|
||||
- cmd:
|
||||
- cd ~/Code/sample/www
|
||||
- rails s
|
||||
width: 50
|
||||
- cmd: memcached -p 11211 -vv
|
||||
height: 25
|
||||
session:
|
||||
name: sample-session
|
||||
windows:
|
||||
- name: sample-window
|
||||
splits:
|
||||
- cmd: cd ~/Code/sample/www
|
||||
- cmd:
|
||||
- cd ~/Code/sample/www
|
||||
- rails s
|
||||
width: 50
|
||||
- cmd: memcached -p 11211 -vv
|
||||
height: 25
|
||||
|
||||
will create a new window named `sample-window` with a layout like this:
|
||||
|
||||
|
@ -16,7 +16,14 @@ module Teamocil
|
||||
def generate_commands # {{{
|
||||
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
|
||||
output << "tmux rename-window #{window["name"]}"
|
||||
|
Loading…
Reference in New Issue
Block a user