How To Automate Mouse Clicks In Linux

The reason many serious Linux aficionados prefer text-based applications over their graphical counterparts isn’t just because they’re so hardcore or stuck in the past. They have very pragmatic reasons for doing so.

Text-mode programs are easier to integrate into scripts, because text-based input can be generated more easily from another program and piped into another.

Although the mouse transformed the computing world when it was invented, in extended use, it can actually become somewhat tedious, especially in repetitive operations. One of the most repetitive is clicking options in dialog boxes. Fortunately, there’s a way to take the drudgery out of this task.

One piece of software, however, makes it possible to automate graphical programs by automating mouse clicks.

auto-mouse-click

You can download the program from Murguu.com. It’s available for both 32-bit and 64-bit machines. The program has been tested on Mint, Ubuntu, Kubuntu and Fedora.

Just unpack the .zip file into a directory and double-click on the “AutoMouseClick” icon. The program will start up and you’ll be able to automate your mouse clicks.

You’ll have to know a bit about how your screen’s coordinates are laid out. It’s similar to the Cartesian geometry you learned in your high school algebra class, but the origin is at the top left corner of the screen instead of the middle like you learned in math class. This is because it’s the same on every screen, no matter how big it actually is.

If you have more than one monitor serving as a single screen, the origin will be at the top left corner of the leftmost screen.

Just press F11 to get a reading of the coordinates of the mouse pointer. You can specify the X and Y Coordinates of each click. You can single click, double-click, left-click, right-click, Ctrl-click, shift-click and just about any kind of click you can imagine.

The program does have to be in focus in order to work, but you can define a keyboard shortcut in order to use it without having to actually click in its window.

To add a mouse click, just click the “Add” button. You can add remove, and rearrange clicks. You can even specify how long to wait between clicks. This is perfect for dialog boxes that take a while to show up.

You can also save your clicks and load them for later retrieval. This makes it a rudimentary version of a shell/Perl/Python script for graphical applications. Similar programs are also available for Windows and Mac OS X, if you think this program is a great idea and want to use it on other systems.

A text-based program and a scripting languages are going to give you a lot more flexibility, but if the only choice you have available is a GUI program and you have a lot of repetitive operations to perform, then the Auto Mouse Click program might be a good choice if you want to save some wear and tear on your wrist or your clicking fingers.

You might even have your hands free to use the keyboard.