Move zsh config to ~/.config

This commit is contained in:
2020-10-11 19:25:48 +02:00
parent 416ed81ceb
commit 81b70af9d3
20 changed files with 5 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
function tmix () {
set -o shwordsplit
SESSION="${TMIX_SESSION:-TMIX}"
SERVERS="${TMIX_SERVERS}"
if [[ $1 == "kill" ]]; then
echo "Killing tmux session $SESSION"
tmux kill-session -t "${SESSION}"
else
if [ -z "$SERVERS" ]; then
# display usage if no parameters given
echo "Usage: tmix"
echo "No servers configured. define them as TMIX_SERVERS=\"<SERVER> <SERVER> <SERVER>\" e.g. in ${ZDOTDIR}/lib/30-extras.zsh"
else
echo "Creating tmux session $SESSION"
tmux new-session -d -s "${SESSION}"
create_session=$?
if [[ $create_session = 0 ]]; then
for SERVER in ${SERVERS}; do
echo ">>> Connecting to ${SERVER}"
tmux new-window -n ${SERVER} -t ${SESSION}:
tmux send-keys -t ${SESSION}:${SERVER} "mosh ${SERVER} -- doas tmux a -d" C-m
done
fi
fi
fi
}