#!/bin/bash # Print the personal bookmarklet that triggers a grid sweep from the browser. set -euo pipefail token_file="${XDG_CONFIG_HOME:-$HOME/.config}/poe-clip-bridge/token" if [[ ! -f $token_file ]]; then echo "No token yet - start the bridge once: systemctl --user start poe-clip-bridge.service" >&2 exit 1 fi token=$(cat "$token_file") echo "Add this as a bookmark (Ctrl+Shift+O -> new bookmark, paste into URL):" echo echo "javascript:fetch('http://127.0.0.1:8477/sweep?token=${token}');void 0" echo echo "Status page (opens a tab instead of staying on the solver page):" echo "http://127.0.0.1:8477/sweep?token=${token}"