dotfiles

config files for my linux setup
git clone git://edryd.org/dotfiles
Log | Files | Refs | README

surf_open (378B)


      1 #!/bin/sh
      2 
      3 xidfile="$HOME/.surf/tabbed.xid"
      4 uri=""
      5 
      6 if [ "$#" -gt 0 ]; then
      7 	uri="$1"
      8 fi
      9 
     10 runtabbed() {
     11 	tabbed -cdn tabbed-surf -r 2 surf -e '' "$uri" >"$xidfile" \
     12 		2>/dev/null &
     13 }
     14 
     15 if [ ! -r "$xidfile" ]; then
     16 	runtabbed
     17 else
     18 	xid=$(cat "$xidfile")
     19 	xprop -id "$xid" >/dev/null 2>&1
     20 	if [ $? -gt 0 ]; then
     21 		runtabbed
     22 	else
     23 		surf -e "$xid" "$uri" >/dev/null 2>&1 &
     24 	fi
     25 fi
     26