summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAAGaming <aagaming@riseup.net>2025-07-13 02:20:42 -0400
committerAAGaming <aagaming@riseup.net>2025-07-13 02:20:42 -0400
commit7188db98776085fc3dd1a6d655babfe0ea90a236 (patch)
tree8e7a3349899a86498a69921f1ad31c7534e9e481 /scripts
parent02e8640ad477bc96bd9857a67a57a2953d0e9769 (diff)
downloaddecky-loader-7188db98776085fc3dd1a6d655babfe0ea90a236.tar.gz
decky-loader-7188db98776085fc3dd1a6d655babfe0ea90a236.zip
feat(dev): make deckdebug.sh configurable
so i can use it on windows :3
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/deckdebug.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/deckdebug.sh b/scripts/deckdebug.sh
index 89d59e18..9ecf63fe 100755
--- a/scripts/deckdebug.sh
+++ b/scripts/deckdebug.sh
@@ -20,7 +20,10 @@ if [ -z "$INSIDE_NIX_RANDOMSTRING" ] && command -v nix &> /dev/null; then
exit $?
fi
-required_dependencies=(websocat jq curl chromium)
+[[ -f "$HOME/.config/deckdebug/config.sh" ]] && source "$HOME/.config/deckdebug/config.sh"
+CHROMIUM="${CHROMIUM:-chromium}"
+
+required_dependencies=(websocat jq curl $CHROMIUM)
# Check if the dependencies are installed
for cmd in "${required_dependencies[@]}"; do
@@ -30,7 +33,7 @@ for cmd in "${required_dependencies[@]}"; do
fi
done
-chromium --remote-debugging-port=9222 &
+$CHROMIUM --remote-debugging-port=9222 &
sleep 2
ADDR=$1
@@ -49,10 +52,14 @@ while :; do
TARGET=$NEWTARGET
TARGETURL="http://$ADDR/devtools/inspector.html?ws=$ADDR/devtools/page/$TARGET"
- LOCALTARGET=$(echo '{"id": 1, "method": "Target.createTarget", "params": {"background": true, "url": "'$TARGETURL'"}}
+ echo '{"id": 1, "method": "Target.createTarget", "params": {"background": true, "url": "'$TARGETURL'"}}
{"id": 2, "method": "Target.closeTarget", "params": {"targetId": "'$LOCALTARGET'"}}' \
- | websocat ws://$LOCAL/devtools/page/$LOCALTARGET \
- | jq -r '.result.targetId')
+ | websocat -t ws://$LOCAL/devtools/page/$LOCALTARGET
+
+ sleep 2
+
+ LOCALTARGETS=$(curl -s http://$LOCAL/json/list)
+ LOCALTARGET=$(jq -r '.[] | select(.title | startswith("DevTools")) | .id' <<< "$LOCALTARGETS")
echo started devtools at $LOCALTARGET
fi