diff --git a/bash/tmux_launcher.bash b/bash/tmux_launcher.bash index 731ecb7..15e43ff 100644 --- a/bash/tmux_launcher.bash +++ b/bash/tmux_launcher.bash @@ -1,17 +1,12 @@ #!/bin/bash -tmux new -s buildsw -d # create new session with a name and detach -tmux rename-window -t buildsw:0 "This is window foo." # rename (default) window 0 of foo to something cool -tmux split-window -t buildsw:0 -v -p 60 # split into top and bottom panes with 60/40 row split -tmux send-keys -t buildsw:0.0 'top' 'C-m' # run a thing in the top pane, can use 'C-m' or 'Enter' -tmux send-keys -t buildsw:0.1 'make all' 'C-m' # run another thing in the bottom pane +tmux new -s sessionname -d # create new session with a name and detach +tmux rename-window -t sessionname:0 "This is window foo." # rename (default) window 0 of foo to something cool +tmux split-window -t sessionname:0 -v -p 60 # split into top and bottom panes with 60/40 row split +tmux send-keys -t sessionname:0.0 'top' 'C-m' # run a thing in the top pane, can use 'C-m' or 'Enter' +tmux send-keys -t sessionname:0.1 'script.bs $@' 'C-m' # run another thing in the bottom pane, passing through cli arguments -sleep 2 # wait for PID to get created and be available for use (Why is this needed?) -MYPID=`pgrep exec2` -tmux attach -t buildsw # jump into the active session to watch things happen -tail --pid=$MYPID -f /dev/null # funky thing tail can do - wait for process to finish! +tmux attach -t sessionname # jump into the active session to watch things happen -tmux send-keys -t buildsw:0.0 'q' 'C-m' # tell 'top' in top pane to quit (C-m probably not needed here...) -tmux kill-session -t buildsw # close tmux session - -# This mostly works, just doesn't seem to exit the session correctly. \ No newline at end of file +tmux send-keys -t sessionname:0.0 'q' 'C-m' # tell 'top' in top pane to quit (C-m probably not needed here...) +tmux kill-session -t sessionname # close tmux session