dotfiles/bin/.bin/sshtmux

12 lines
248 B
Plaintext
Raw Normal View History

#!/bin/sh
# A name for the session
session_name="$(whoami)_sess"
if [ ! -z $1 ]; then
2024-01-03 11:04:20 +01:00
ssh -t "$1" "tmux attach -t $session_name || DISPLAY=:0 tmux new -s $session_name"
else
echo "Usage: sshtmux HOSTNAME"
echo "You must specify a hostname"
fi