diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-01-13 15:37:49 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-01-13 15:37:49 -0200 |
commit | 454c6e3c77b3db507ee81875219089047fc2d5a3 (patch) | |
tree | 34ea351902ddd6094bc0a96a65b4bc07e9ee83d8 /wscreen | |
download | scripts-454c6e3c77b3db507ee81875219089047fc2d5a3.tar.gz scripts-454c6e3c77b3db507ee81875219089047fc2d5a3.tar.bz2 |
Initial import
Diffstat (limited to 'wscreen')
-rwxr-xr-x | wscreen | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -0,0 +1,30 @@ +# +# Workscreen: screen session wrapper. +# + +# Default options. +opts="-c /etc/screenrc" + +# Remove dead screens. +screen -wipe &> /dev/null + +# Session selection. +if [ ! -z "$1" ]; then + if screen -ls $1 | grep -q "There is a screen on"; then + #echo "There's already a screen called $1" + #exit 1 + screen -x $1 + exit $? + else + session="-S $1" + fi + + if [ "$1" == "main" ]; then + opts="" + elif [ -f "$HOME/.screen/$1" ]; then + opts="-c $HOME/.screen/$1" + fi +fi + +# Start session. +screen $opts $session |