From af90d6fdfee51454646bb218e831792fd7bf198e Mon Sep 17 00:00:00 2001 From: raul Date: Thu, 18 Jan 2024 06:52:05 +0100 Subject: [PATCH] Startup --- README.md | 10 +++++++++- clicks.sh | 4 ++++ toggler.sh | 24 ++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 clicks.sh create mode 100755 toggler.sh diff --git a/README.md b/README.md index d45500f..a4dd161 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +<<<<<<< HEAD # x11-autoclicker -Rudimentary autoclicker for X11 Linux setups \ No newline at end of file +Rudimentary autoclicker for X11 Linux setups +======= +# Test + +* Element 1 + +* Element 2 +>>>>>>> ad1d17c (Startup) diff --git a/clicks.sh b/clicks.sh new file mode 100755 index 0000000..1868176 --- /dev/null +++ b/clicks.sh @@ -0,0 +1,4 @@ +#!/bin/bash +while true; do + xdotool click 1 +done diff --git a/toggler.sh b/toggler.sh new file mode 100755 index 0000000..bf64efd --- /dev/null +++ b/toggler.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +cmd="$(which xdotool)" +# TODO: improve error handling +# cmd="/usr/local/bin/xdotool" + +if test -e "$cmd"; then + echo "[+] xdotool exists, continuing the script!" +else + echo "[-] xdotool doesn't exist, this script won't run on your computer" + exit 2 +fi + + + +if pidof -x clicks.sh > /dev/null; then + #echo "clicks is active, deactivating" + notify-send "Clicks is active, deactivating" & + kill $(pidof -x clicks.sh) +else + notify-send "Clicks isn't active, activating" & + #echo "clicks isn't active, activating" + $(find ~ -name 'clicks.sh') | head -n1 & +fi