Created
February 7, 2015 21:16
-
-
Save foca/1d396698c2f9fc71b0e4 to your computer and use it in GitHub Desktop.
A tool to load a `.tmuxify.layout` file and open a GNU Screen session with it. See https://github.com/tonchis/tmuxify
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
#!/usr/bin/env bash | |
set -e | |
[ -n "$DEBUG" ] && set -x | |
layout="$(pwd)/.tmuxify.layout" | |
if [ ! -f "$layout" ]; then | |
echo "Can't find ./.tmuxify.layout" >&2 | |
exit 1 | |
fi | |
session="${1:-$(basename $(pwd))}" | |
screen -S "$session" -d -m | |
cat "$layout" | while read window pane command; do | |
screen -S "$session" -X screen -t "$window" "pane"; | |
screen -S "$session" -X select "pane"; | |
screen -S "$session" -X stuff "$command\n"; | |
done | |
screen -rd "$session"; |
Pretty! You should make this easily installable!
Or maybe I can just curl the file into my PATH because I have run out of fucks to give.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The way to select the session that will be active at the end is to make it the last one in the
.tmuxify.layout
file. So for example, with this file:Vim (window 0) will be the one selected when the user runs
screenify
.