surf-open.sh - surf - surf browser, a WebKit based browser | |
git clone git://git.suckless.org/surf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
surf-open.sh (444B) | |
--- | |
1 #!/bin/sh | |
2 # | |
3 # See the LICENSE file for copyright and license details. | |
4 # | |
5 | |
6 xidfile="$HOME/tmp/tabbed-surf.xid" | |
7 uri="" | |
8 | |
9 if [ "$#" -gt 0 ]; | |
10 then | |
11 uri="$1" | |
12 fi | |
13 | |
14 runtabbed() { | |
15 tabbed -dn tabbed-surf -r 2 surf -e '' "$uri" >"$xidfile" \ | |
16 2>/dev/null & | |
17 } | |
18 | |
19 if [ ! -r "$xidfile" ]; | |
20 then | |
21 runtabbed | |
22 else | |
23 xid=$(cat "$xidfile") | |
24 xprop -id "$xid" >/dev/null 2>&1 | |
25 if [ $? -gt 0 ]; | |
26 then | |
27 runtabbed | |
28 else | |
29 surf -e "$xid" "$uri" >/dev/null 2>&1 & | |
30 fi | |
31 fi | |
32 |