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

29
scripts/hold_key.sh Normal file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
# hold_key.sh - Hold a key for specified duration
# Usage: hold_key.sh "key" duration_seconds
export DISPLAY=:99
KEY="$1"
DURATION="$2"
if [ -z "$KEY" ] || [ -z "$DURATION" ]; then
echo "ERROR: Usage: hold_key.sh \"key\" duration_seconds" >&2
exit 1
fi
# Validate duration is reasonable
if (( $(echo "$DURATION > 100" | bc -l) )); then
echo "ERROR: Duration too long (max 100 seconds)" >&2
exit 1
fi
xdotool keydown "$KEY"
sleep "$DURATION"
xdotool keyup "$KEY"
echo "Held $KEY for $DURATION seconds"
# Auto-screenshot after action
sleep 2
exec "$(dirname "$0")/screenshot.sh"