Skip to content

Instantly share code, notes, and snippets.

@foca
Created February 7, 2015 21:16
Show Gist options
  • Save foca/1d396698c2f9fc71b0e4 to your computer and use it in GitHub Desktop.
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
#!/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";
@pote
Copy link

pote commented Feb 7, 2015

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