2

xdotool click 1 works as it should: the left mouse button is clicked once.

On the other hand, whenever I enter xdotool behave_screen_edge bottom click 1 in the terminal, the command does not terminate. It's like the terminal is still waiting for input from me:

enter image description here

same goes for example of a command from the manual (!), xdotool behave_screen_edge bottom-left search --class google-chrome windowactivate

Any input is appreciated.

2

Short answer

Obviously, those commands run an event loop, and do what they should do until you terminate the command (or close the terminal):

xdotool behave_screen_edge bottom click 1

clicks the left button if you hit the bottom of your screen, and

xdotool behave_screen_edge bottom-left search --class google-chrome windowactivate

activates Chrome windows when you move the mouse to bottom-left. Both commands do that on every occasion, until you kill the process:

enter image description here

How to run it on startup

From a comment, I understand you want to run commands like this on startup. To add it to Startup Applications:

  • on XFCE (Xubuntu):

    Settings > Session and Startup > Application Autostart > Add. Add the command:

    /bin/bash -c "sleep 15 && xdotool behave_screen_edge bottom-left search --class google-chrome windowactivate"
    
  • On Unity:

    Dash > Startup Applications > Add. Add the (same) command:

    /bin/bash -c "sleep 15 && xdotool behave_screen_edge bottom-left search --class google-chrome windowactivate"
    
  • Thanks for the explanation but please also explain why you say that "Those commands run in a loop" instead of just "Those commands do what they should do until you terminate the command (or close the terminal)"? – DK Bose Mar 7 '16 at 12:20
  • @DKBose obviously, they run in a loop, waiting for an event to happen (the mouse to hit the bottom/bottom-left), exactly like a mainloop() of a gui. – Jacob Vlijm Mar 7 '16 at 12:32
  • 1
    @DKBose see updated answer – Jacob Vlijm Mar 7 '16 at 12:57
  • Thank you! I asked because I'm not at all familiar with programming terminology. – DK Bose Mar 7 '16 at 13:00
  • oh well! I should have seen that. So if I wanted to keep this behaviour up forever, I'd need to run it in a seperate terminal forever? – Blauhirn Mar 7 '16 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.