You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
444 B

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