HokieGeek / dotfiles

My linux config files
0 stars 0 forks source link

Create mutliplexing script #96

Closed HokieGeek closed 8 years ago

HokieGeek commented 9 years ago

Will be used within any posix compliant shell script config

HokieGeek commented 9 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
}
HokieGeek commented 9 years ago

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
HokieGeek commented 8 years ago

Did this better in the bin repo