autohotkeyautokey

How to run AutoKey on Linux from CLI?


I found a linux port of Autohotkey here: https://github.com/autokey/autokey

Question: how can I run those AutoKey scripts from command line, or embedded into shell scripts?

If not possible, is there any port of Autohotkey for Linux that is able to run from cmd?


Solution

  • First, AutoKey is not related to AutoHotKey. Notably, our scripts are written in Python 3 which allows you to do almost anything limited only by your imagination and Python coding skills. AHK uses a proprietary language for its scripts which is powerful, but not as general.

    You can run AutoKey scripts from the CLI using autokey.run, but that isn't used very frequently. AutoKey's main claim to fame is being able to launch sequences of keyboard and mouse events based on a trigger abbreviation or hotkey. If you don't need that, then you will probably be better off writing a script in bash or your favorite programming language and using xdotool and wmctrl to interact with your GUI.

    I just saw a limited port of AHK to Linux, but it is not ready for end users.

    I believe that the espanso project has a utility to convert AHK scripts into their native scripting language, but I have not used espanso.

    If you want to explore AutoKey, we have an extensive wiki with articles on features and lots of examples. We also offer support on our forum and on Gitter. The forum is best for basic support while more technical questions will get a better answer on Gitter.