summaryrefslogtreecommitdiff
path: root/mut/bin
diff options
context:
space:
mode:
authorMike Vink <mike@pionative.com>2025-01-20 10:59:33 +0100
committerMike Vink <mike@pionative.com>2025-01-20 10:59:33 +0100
commitd659a2d6da6d8d9aa166a33a18025606434f136f (patch)
tree61d0c914657319d2a30646fb3c8d11d0c27260d1 /mut/bin
parent883055eb4182cdb8ebf784a2171771de7334f95e (diff)
some surf related changes
Diffstat (limited to 'mut/bin')
-rwxr-xr-xmut/bin/surf-open.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/mut/bin/surf-open.sh b/mut/bin/surf-open.sh
new file mode 100755
index 0000000..c22edc2
--- /dev/null
+++ b/mut/bin/surf-open.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# See the LICENSE file for copyright and license details.
+#
+
+xidfile="$HOME/tmp/tabbed-surf.xid"
+uri=""
+
+if [ "$#" -gt 0 ];
+then
+ uri="$1"
+fi
+
+runtabbed() {
+ tabbed -dn tabbed-surf -r 2 surf -e '' "$uri" >"$xidfile" \
+ 2>/dev/null &
+}
+
+if [ ! -r "$xidfile" ];
+then
+ runtabbed
+else
+ xid=$(cat "$xidfile")
+ xprop -id "$xid" >/dev/null 2>&1
+ if [ $? -gt 0 ];
+ then
+ runtabbed
+ else
+ surf -e "$xid" "$uri" >/dev/null 2>&1 &
+ fi
+fi
+