diff --git a/homes/palo/i3.nix b/homes/palo/i3.nix index 603a81a..0b04f88 100644 --- a/homes/palo/i3.nix +++ b/homes/palo/i3.nix @@ -55,6 +55,7 @@ in pkgs.autorandr pkgs.polygon-art.polygon-art pkgs.xdotool # needed for rofi-emoji + pkgs.xclicker # makes stuff much easier ]; programs.i3status-rust = { diff --git a/homes/palo/packages/graphics.nix b/homes/palo/packages/graphics.nix index 8d6381e..074d5b1 100644 --- a/homes/palo/packages/graphics.nix +++ b/homes/palo/packages/graphics.nix @@ -27,6 +27,9 @@ with lib; qrencode + xclicker + xdotool + ]; }; diff --git a/scripts/bash_mouse_click.sh b/scripts/bash_mouse_click.sh new file mode 100644 index 0000000..0d8074b --- /dev/null +++ b/scripts/bash_mouse_click.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# Function to perform a mouse click at specific coordinates +click_at() { + local x=$1 + local y=$2 + xdotool mousemove "$x" "$y" click 1 +} + +# First click coordinates (replace with desired values) +# use xclicker to find location +FIRST_X=2198 +FIRST_Y=145 + +# Second click coordinates (replace with desired values) +# use xclicker to find location +SECOND_X=745 +SECOND_Y=912 + +# Number of repetitions passed as script argument +REPETITIONS=$1 + +# Validate that the number of repetitions is a positive integer +if ! [[ "$REPETITIONS" =~ ^[0-9]+$ ]]; then + echo "Error: Number of repetitions must be a positive integer." + exit 1 +fi + +# Countdown from 10 +echo "Starting in..." +for (( i=10; i>0; i-- )) +do + echo "$i..." + sleep 1 +done + +# Repeat the clicks n times +for (( i=0; i<$REPETITIONS; i++ )) +do + # Perform first click + click_at $FIRST_X $FIRST_Y + + # Wait for 5 seconds + sleep 5 + + # Perform second click + click_at $SECOND_X $SECOND_Y + sleep 1 + click_at $SECOND_X $SECOND_Y + + # Wait for 5 seconds + sleep 2 +done + +# Resetting the coordinates transformation matrix to default +xinput set-prop "Virtual core pointer" "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1 \ No newline at end of file