Run autoclick in the background

0

I wanted to run an autoclick but it only worked with the maximized terminal, when it was minimized by pressing f1 I did not answer the clicks I was reading a post on execution in the background but I did not understand how I could do it here is the script:

#!/bin/bash 
while true; do 
read -sn3 key 
if [ "$key" = "$(tput kf1) " ]; then
 xdotool click 1 
 xdotool click 1 
 xdotool click 1 

fi 
done

How could I make it work?

I also want to know how (tput kf1) modify it to the left click

    
asked by Kiyosaki 26.07.2018 в 06:26
source

1 answer

0

Regarding this problem:

  

when it was minimized by pressing f1 it did not respond

you could do something like this:

$ ./script &
           ^--- ejecutar script en segundo plano desde el principio

author of this response: marc-b

An alternative to this, that I found is to write a function

Foo(){
Do stuff
}

and call the function and send it to the bottom

Foo &

All in the script , so you do not have to do

script.sh &

Instead, just invoking the script will send it to the background.

Author of this response: tejaswi-prakash

source: automatically running a bash script in the background

    
answered by 26.07.2018 в 13:24