Skip to content

Instantly share code, notes, and snippets.

@bmbove
Created June 27, 2014 18:19
Show Gist options
  • Save bmbove/4b277570d0b39c12c22c to your computer and use it in GitHub Desktop.
Save bmbove/4b277570d0b39c12c22c to your computer and use it in GitHub Desktop.
tmux work env startup with teamocil profiles
#!/bin/sh
i3-msg "workspace $1"
tmux has-session -t $1
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
URXVT_C="tmux a -t $1"
urxvt -e bash -c "$URXVT_C" &
else
URXVT_C="tmux new -s $1"
urxvt -e bash -c "$URXVT_C" &
while [ $RETVAL -ne 0 ]; do
tmux has-session -t $1
RETVAL=$?
done
tmux send-keys -t ${1}.0 "teamocil $1" Enter
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment