]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Open accidentally closed www
authorSergey Matveev <stargrave@stargrave.org>
Tue, 17 Nov 2020 08:10:17 +0000 (11:10 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 17 Nov 2020 08:10:17 +0000 (11:10 +0300)
bin/bin/www

index b92ce8ae26d0786073560d84f6d64195f1769835..e7beed973f3a2fe416f2b9f0c66d14b40410f946 100755 (executable)
@@ -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