Initial commit with translated description

This commit is contained in:
2026-03-29 13:18:25 +08:00
commit 4ca4dbf396
19 changed files with 803 additions and 0 deletions

24
scripts/screenshot.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
# screenshot.sh - Capture screen and return base64 PNG
# Resolution: 1024x768 (XGA)
export DISPLAY=:99
OUTPUT_DIR="/tmp/computer-use"
mkdir -p "$OUTPUT_DIR"
TIMESTAMP=$(date +%s%N)
FILE="$OUTPUT_DIR/screenshot_$TIMESTAMP.png"
# Take screenshot
scrot -o "$FILE" 2>/dev/null
if [ ! -f "$FILE" ]; then
echo "ERROR: Failed to take screenshot" >&2
exit 1
fi
# Output base64
base64 -w0 "$FILE"
# Cleanup
rm -f "$FILE"