]> Sergey Matveev's repositories - dotfiles.git/blobdiff - bin/bin/www
Raise sleep again for lynx startup
[dotfiles.git] / bin / bin / www
index a7a62626105592a244d0186bb7c25f8ea7143d3a..99cbe936d7c17019e47ddfb534f530470c69f530 100755 (executable)
@@ -1,5 +1,18 @@
 #!/bin/sh
 
-winid=`NOTABSTART=$NOTABSTART start-tabbed.sh lynx -f start-lynx.sh`
-[ $# -gt 0 ] || exit 0
-exec ~/bin/start-lynx.sh $winid $@
+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 "sleep 0.5 ; lynx $@"
+    tmux set-option -t www default-command lynx
+    term &
+fi