This commit is contained in:
2026-04-09 00:39:54 +03:00
parent 03fab63ebf
commit 503136d067
18 changed files with 9366 additions and 14 deletions

0
scripts/osrs/autoclicker/run-ydotool-daemon.sh Normal file → Executable file
View File

View File

@@ -1,3 +1,5 @@
#!/bin/bash
export YDOTOOL_SOCKET="$HOME/.ydotool_socket"
ydotool click 0xC0 # Left click

View File

@@ -6,7 +6,7 @@
# Configuration
MOVE_DISTANCE=70
MOVE_DISTANCE=66
BOTTOM_MARGIN=190
RANDOM_DELAY_MIN=0
@@ -18,6 +18,8 @@ WL_FIND_CURSOR_BIN="/home/raga/repos/linux/wl-find-cursor/wl-find-cursor"
ENABLED_FILE="/tmp/osrs_drop__enabled"
LOCK_FILE="/tmp/osrs_drop__lock"
export YDOTOOL_SOCKET="$HOME/.ydotool_socket"
# Verify dependencies
if ! command -v ydotool &> /dev/null; then
echo "Error: ydotool is not installed. Install it with: sudo pacman -S ydotool"

72
scripts/video-chop.sh Executable file
View File

@@ -0,0 +1,72 @@
#!/bin/bash
# Video chop script - extracts a portion of a video file using ffmpeg
# Usage: video-chop.sh <video_file> <start_seconds> <end_seconds>
set -e
# Check if all required parameters are provided
if [ $# -ne 3 ]; then
echo "Usage: $0 <video_file> <start_seconds> <end_seconds>"
echo "Example: $0 /path/to/video.mp4 10 30"
echo " This will extract from second 10 to second 30"
exit 1
fi
VIDEO_FILE="$1"
START_SECONDS="$2"
END_SECONDS="$3"
# Validate that the video file exists
if [ ! -f "$VIDEO_FILE" ]; then
echo "Error: Video file '$VIDEO_FILE' not found"
exit 1
fi
# Validate that start and end are numbers
if ! [[ "$START_SECONDS" =~ ^[0-9]+\.?[0-9]*$ ]]; then
echo "Error: Start seconds must be a valid number"
exit 1
fi
if ! [[ "$END_SECONDS" =~ ^[0-9]+\.?[0-9]*$ ]]; then
echo "Error: End seconds must be a valid number"
exit 1
fi
# Validate that end is greater than start
if (( $(echo "$END_SECONDS <= $START_SECONDS" | bc -l) )); then
echo "Error: End seconds must be greater than start seconds"
exit 1
fi
# Get the directory and filename
DIRNAME=$(dirname "$VIDEO_FILE")
BASENAME=$(basename "$VIDEO_FILE")
# Get the file extension
EXTENSION="${BASENAME##*.}"
FILENAME="${BASENAME%.*}"
# Generate timestamp prefix (YYYYMMDD_HHMMSS)
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
# Create output filename with timestamp prefix
OUTPUT_FILE="${DIRNAME}/${TIMESTAMP}_${FILENAME}.${EXTENSION}"
# Calculate duration
DURATION=$(echo "$END_SECONDS - $START_SECONDS" | bc)
echo "Input file: $VIDEO_FILE"
echo "Start: ${START_SECONDS}s"
echo "End: ${END_SECONDS}s"
echo "Duration: ${DURATION}s"
echo "Output file: $OUTPUT_FILE"
echo ""
# Run ffmpeg to extract the portion
# Using -ss before -i for fast seeking, and -t for duration
ffmpeg -y -ss "$START_SECONDS" -i "$VIDEO_FILE" -t "$DURATION" -c copy "$OUTPUT_FILE"
echo ""
echo "Done! Output saved to: $OUTPUT_FILE"