surf

Mahdi's build of surf
git clone git://mahdi.pw/surf.git
Log | Files | Refs | README | LICENSE

surf-open (503B)


      1 #!/bin/sh
      2 xidfile="/tmp/tabbed-surf.xid"
      3 uri=""
      4 
      5 [ "$#" -gt 0 ] && uri="$1"
      6 [ "$(xprop -id "$(cat "$xidfile")" | awk '/WM_CLASS/{sub(/",/, "", $3);sub(/"/, "", $3);print $3}')" = "tabbed-surf" ] || rm "$xidfile"
      7 
      8 runtabbed() {
      9 	tabbed -cdn tabbed-surf -r 2 surf -e '' "$uri" >"$xidfile" \
     10 		2>/dev/null &
     11 }
     12 
     13 if [ ! -r "$xidfile" ]; then    runtabbed; else
     14 	xid=$(cat "$xidfile")
     15 	xprop -id "$xid" >/dev/null 2>&1
     16 	if [ $? -gt 0 ]; then   runtabbed; else
     17 		surf -e "$xid" "$uri" >/dev/null 2>&1 &
     18 	fi
     19 fi