[object Object]

← back to Ken

auto-save: 2026-08-03T13:24:27 (1 files) — kalshi-dash/ken-refresh-site.sh

982c1f4b176fe2c4e3413daa7cea0aed0cc66352 · 2026-08-03 13:24:37 -0700 · Steve Abrams

Files touched

Diff

commit 982c1f4b176fe2c4e3413daa7cea0aed0cc66352
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 3 13:24:37 2026 -0700

    auto-save: 2026-08-03T13:24:27 (1 files) — kalshi-dash/ken-refresh-site.sh
---
 kalshi-dash/ken-refresh-site.sh | 46 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/kalshi-dash/ken-refresh-site.sh b/kalshi-dash/ken-refresh-site.sh
new file mode 100755
index 0000000..26d1491
--- /dev/null
+++ b/kalshi-dash/ken-refresh-site.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+# ken-refresh-site.sh — reload the Ken dashboard tab (127.0.0.1:7810) in whichever
+# browser currently has it open. Only touches ALREADY-RUNNING browsers (never launches one).
+# Reloads ALL matching tabs; prints how many it refreshed.
+URLMATCH="${1:-127.0.0.1:7810}"
+n=0
+# Chromium-family (Chrome/Brave/Arc/Edge): tab has .reload
+for app in "Google Chrome" "Brave Browser" "Arc" "Microsoft Edge"; do
+  osascript >/dev/null 2>&1 <<OSA && n=$((n+1))
+tell application "System Events" to if not (exists process "$app") then error "notrunning"
+tell application "$app"
+  set hit to false
+  repeat with w in windows
+    repeat with t in tabs of w
+      if (URL of t) contains "$URLMATCH" then
+        tell t to reload
+        set hit to true
+      end if
+    end repeat
+  end repeat
+  if not hit then error "notab"
+end tell
+OSA
+done
+# Safari: reload by re-setting URL to itself
+osascript >/dev/null 2>&1 <<'OSA' && n=$((n+1))
+tell application "System Events" to if not (exists process "Safari") then error "notrunning"
+tell application "Safari"
+  set hit to false
+  repeat with w in windows
+    repeat with t in tabs of w
+      if (URL of t) contains "127.0.0.1:7810" then
+        set URL of t to (URL of t)
+        set hit to true
+      end if
+    end repeat
+  end repeat
+  if not hit then error "notab"
+end tell
+OSA
+if [ "$n" -eq 0 ]; then
+  # no existing tab found -> (re)open the dashboard fresh in the default browser
+  open "http://${URLMATCH}/" 2>/dev/null && echo "ken-refresh-site: no tab found -> reopened http://${URLMATCH}/ fresh"
+else
+  echo "ken-refresh-site: reloaded the 7810 tab in $n browser(s)"
+fi

← 07bb411 auto-save: 2026-08-03T12:23:59 (1 files) — kalshi-dash/ken-t  ·  back to Ken  ·  fix: migrate Kalshi exit orders + manual create_order to v2 9969827 →