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

49
scripts/scroll.sh Normal file
View File

@@ -0,0 +1,49 @@
#!/bin/bash
# scroll.sh - Scroll in a direction
# Usage: scroll.sh direction amount [x y]
# direction: up, down, left, right
# amount: number of scroll units
export DISPLAY=:99
DIRECTION="$1"
AMOUNT="${2:-3}"
X="$3"
Y="$4"
if [ -z "$DIRECTION" ]; then
echo "ERROR: Usage: scroll.sh direction [amount] [x y]" >&2
exit 1
fi
# Move to position if specified
if [ -n "$X" ] && [ -n "$Y" ]; then
xdotool mousemove --sync "$X" "$Y"
fi
# Map direction to button
case "$DIRECTION" in
up)
BUTTON=4
;;
down)
BUTTON=5
;;
left)
BUTTON=6
;;
right)
BUTTON=7
;;
*)
echo "ERROR: Unknown direction: $DIRECTION (use up/down/left/right)" >&2
exit 1
;;
esac
xdotool click --repeat "$AMOUNT" "$BUTTON"
echo "Scrolled $DIRECTION $AMOUNT times"
# Auto-screenshot after action
sleep 2
exec "$(dirname "$0")/screenshot.sh"