Closed HokieGeek closed 8 years ago
[ -f "/usr/bin/tmux" ] && {
sessionfile="/tmp/tmux-recover-session"
[ -f "${sessionfile}" ] && {
sessionid=`cat ${sessionfile}`
rm -rf ${sessionfile} 2>&1 >/dev/null
exec tmux attach-session -t ${sessionid}
} || {
exec tmux
}
} || [ -f "/usr/bin/screen" ] && {
exec screen
}
tmux-open-detached.sh
#!/bin/sh
unset TMUX
for sessionid in `tmux ls | grep -v attached | cut -d: -f1`; do
echo ${sessionid} > /tmp/tmux-recover-session
urxvtc
sleep 0.25s
done
Did this better in the bin repo
Will be used within any posix compliant shell script config