Is there an equivalent product/method for AutoHotkey?

For those that don't know, it's a product that allows you to program your mouse movements and keyboard. This allows me to "macro" certain functions on programs instead of having to do it manually. In the old days they used to call them keyboard stuffers. But that is only half of the solution as I need a "mouse movement" stuffer as well.

Is there such a beast?

8 Answers 8


There's a port of AutoHotKey to Linux called IronAHK and a similar tool called Autokey. I haven't used either, I don't know how well they work.

Other than such programs, you won't find exactly the same kind of automation tools. The basic user automation tool on unix systems is the shell. The shell is the glue that combines other tools: it can launch external programs and control how they exchange data. The shell itself doesn't include anything to manipulate GUI concepts like windows and the mouse pointer¹. What you do is call specialized tools in a shell script, in particular xdotool to manipulate windows, and inject keystrokes and mouse events.

For example, the following script clicks at the position (40,20) in the window of Myapp.

xdotool search --class Myapp \
        mousemove --window %1 40 20 \
        click 1

¹ Except for dtksh, but I've never seen a Linux port of it.

  • 1
    Nice summary, pity the project is 4 years out of date and the binaries are all 404's, will give the xdotool a try though. Thanks for taking the time.
    – Meer Borg
    Commented Oct 31, 2014 at 6:36
  • 1
    tried out xdotool, works like a charm but you should definitely read their docs before starting Commented Sep 16, 2016 at 13:59
  • 2
    AFAIK, IronAHK never got fully implemented and has been abandoned.
    – Joe
    Commented Aug 1, 2019 at 16:07

There are several projects that address this. The two most active ones, AFAIK, are sikuli and AutoKey (a project I help support.)

I have not used sikuli, but it appears to be based on finding patterns on the screen and triggering actions based on them.

AutoKey allows the user to define trigger phrases and hotkeys which expand phrases (similar to a very powerful autocorrect feature) or run scripts written in Python3 that are only limited by the user's programming skills. It provides an API for keyboard and mouse event generation. It also integrates with Xautomation which allows you to find a small image on the screen and move the mouse cursor to it.

I have been using AutoKey for many years and supporting it on our list. It's like a number of productivity tools: you can get by without it, but once you start using it, you'll wonder how you ever did without it.

Some specifics:

AutoKey does not work with AutoHotKey definitions and scripts. They will have to be rewritten.

I did write a proof of concept bash script (available upon request) which translates AutoHotKey phrases into AutoKey phrases, but it is only a starting point and ignores most of AutoHotKey's options.

Since AutoKey scripts are written in Python3, it is also possible to call out to tools such as xdotool and wmctrl from within a script to provide additional functionality, but this is typically not necessary. Although AutoKey scripts are written in Python, quite a lot can be accomplished with a very limited knowledge of Python. You don't need to be a fluent Python programmer for most purposes.

If you use a Debian-based distribution, please don't install the version of AutoKey provided by your distribution. Their AutoKey package is unmaintained and very old. Get a current version from us. Edit: This was corrected in Debian testing and derivatives in 2020. They now offer the most current release.


Here's a noob solution for noobs like me:

Most Desktop Environments (DE) include a built-in keyboard shortcut editor. Using the shortcut editor, you can write custom bash scripts, console commands, etc.

To get AHK-like functionality beyond what your DE makes possible via custom shortcuts, install xdotool (sudo apt install xdotool) and write your xdotool commands into the shortcut editor (if you're given options for several types of shortcuts, select the "command" option):

xdotool [command]

(Enter man xdotool in the terminal to access the xdotool manual.)

If you use xdotool to extend your custom shortcuts, it's a good idea to enter your command in the terminal before setting it as a hotkey, just to make sure it works as expected.

I have yet to figure out how to get AHK-like hotstrings in Linux, but I'll update if I discover a workable solution.


You can use xautomation in Linux. I use it on Raspberry Pi display screens, to send F5 page refreshes and 'Return' (enter) keystrokes for logins.


Use AutohotkeyX, it's a recent WINE port of autohotkey which, according to winehq testing, does everything that Autohokey is able to do on windows. It's easily the best and most straightforward answer.


I haven't personally tested this, but WINEHQ results tend


As of 2022, there are still no finished AHK equivalents on Linux. There are however two alternatives in development, KeySharp (cross-plattform, C#, v2-like syntax) and AHK_X11 (Linux, Crystal, classic syntax (2004 spec)). The new AHK wiki at https://autohotkey.wiki/alternatives gives links and a good overview.


Download Autohotkey on Linux. Create a Autohotkey file (example.ahk). Use wine to run Ahk2Exe.exe from the Autohotkey folder. Compile your example.ahk file to example.exe Use wine to run example.exe

  • 2
    It's not a good option. For now, the functionality of Autohotkey run through wine is very limited: appdb.winehq.org/….
    – banan3'14
    Commented Sep 7, 2018 at 18:06

Just use XEV and XMODMAP. SIMPLE and better than dedicated programs or emulating crappy Windows apps. All my LINUX stuff uses scripts to redefine keys and change screen modes and then, when the program is done and exits, set everything back to normal. It's about just as easy to use XMODMAP and make a script as it is to make an AHK script, but with the added bonus of not having to run an emulated Windows app.

  • 8
    This answer might, for all I know, be 100% correct and accurate.  However, it would be a lot more useful if it included some examples and / or instructions, or even links to further documentation. Commented Jul 10, 2019 at 22:49
  • I don't think one deserves the down votes.. it's not That bad.. I mean yes It lacks basic info but; really; sorry; Commented Jul 23, 2022 at 5:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .