Created
February 26, 2013 12:32
-
-
Save clauswitt/5038107 to your computer and use it in GitHub Desktop.
Creating tmuxinator conf file from a current session in tmux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
SESSION_NAME=$1 | |
FILENAME="$HOME/.tmuxinator/${2:-$SESSION_NAME}.yml" | |
WINDOW_NAMES=`tmux list-windows -t $SESSION_NAME -F "#{window_name}"` | |
SESSION_PATH=`tmux list-panes -t $SESSION_NAME -F "#{pane_start_path}"` | |
echo $FILENAME | |
touch "$FILENAME" | |
echo "project_name: $SESSION_NAME" >> "$FILENAME" | |
echo "project_root: $SESSION_PATH" >> "$FILENAME" | |
echo "tabs:" >> "$FILENAME" | |
for WINDOW in $WINDOW_NAMES; do | |
echo " - $WINDOW: " >> "$FILENAME" | |
done | |
$EDITOR "$FILENAME" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment