[object Object]

← back to Waitline

fix statusline python f-string quoting; verified end-to-end

2b2fed8847ffb2427fc3639f7361fb0c3e4c0e5c · 2026-08-01 19:33:55 -0700 · Steve Abrams

Files touched

Diff

commit 2b2fed8847ffb2427fc3639f7361fb0c3e4c0e5c
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sat Aug 1 19:33:55 2026 -0700

    fix statusline python f-string quoting; verified end-to-end
---
 statusline.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/statusline.sh b/statusline.sh
index 81247d0..9eceef6 100755
--- a/statusline.sh
+++ b/statusline.sh
@@ -19,7 +19,13 @@ if [[ $fresh -eq 0 ]]; then
   curl -s --max-time 1 "http://127.0.0.1:${PORT}/api/ad?session=${session}" -o "$CACHE" 2>/dev/null
 fi
 
-line=$(/usr/bin/python3 -c 'import json;d=json.load(open("'"$CACHE"'"));print(f"{d.get(\"sponsor\",\"\")}: {d.get(\"line\",\"\")} · ${d.get(\"earned_total_usd\",0):.4f} earned")' 2>/dev/null)
+line=$(/usr/bin/python3 - "$CACHE" 2>/dev/null <<'PY'
+import json, sys
+d = json.load(open(sys.argv[1]))
+if d.get("line"):
+    print("%s: %s · $%.4f earned" % (d.get("sponsor",""), d["line"], d.get("earned_total_usd",0)))
+PY
+)
 
 if [[ -n "$line" ]]; then
   echo "💰 ${line} | ${model}"

← 51ec068 waitline: Kickbacks.ai clone — statusline ad server + 50% re  ·  back to Waitline  ·  (newest)