X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=bin%2Fbin%2Fwww;h=99cbe936d7c17019e47ddfb534f530470c69f530;hb=2ff43e7b09cf49f13c0552d3e773d853c1c60757;hp=b92ce8ae26d0786073560d84f6d64195f1769835;hpb=1dc248a36734b5f40d07f046945d8c3e5bdb0660;p=dotfiles.git diff --git a/bin/bin/www b/bin/bin/www index b92ce8a..99cbe93 100755 --- a/bin/bin/www +++ b/bin/bin/www @@ -1,9 +1,18 @@ #!/bin/sh +term() { + DISPLAY=:0 CMD="tmux attach-session -t www" CMDTITLE="Terminal9" $HOME/bin/dwm-term & +} + if tmux has-session -t www 2> /dev/null ; then + attached=`tmux list-sessions -F "#{session_attached}" -f "#{==:#{session_name},www}"` + [ "$attached" != "0" ] || { + term & + sleep 0.5 + } tmux new-window -t www "lynx $@" else - tmux new-session -d -s www "lynx $@" + tmux new-session -d -s www "sleep 0.5 ; lynx $@" tmux set-option -t www default-command lynx - DISPLAY=:0 CMD="tmux attach-session -t www" CMDTITLE="Terminal9" $HOME/bin/dwm-term & + term & fi