From: Sergey Matveev Date: Tue, 17 Nov 2020 08:10:17 +0000 (+0300) Subject: Open accidentally closed www X-Git-Url: http://www.git.stargrave.org/?p=dotfiles.git;a=commitdiff_plain;h=f1910301afdfd1dfc489b108dfcf9f6b1dfabad4 Open accidentally closed www --- diff --git a/bin/bin/www b/bin/bin/www index b92ce8a..e7beed9 100755 --- a/bin/bin/www +++ b/bin/bin/www @@ -1,9 +1,15 @@ #!/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 tmux new-window -t www "lynx $@" + attached=`tmux list-sessions -F "#{session_attached}" -f "#{==:#{session_name},www}"` + [ "$attached" != "0" ] || term & else tmux new-session -d -s www "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