We want AHK for Linux!

Propose new features and changes
Posts: 25
Joined: 19 Oct 2018, 22:04

We want AHK for Linux!

18 Dec 2018, 12:54

Hey there. I'm new to this language, and I am also a new Linux user. One thing I really miss is AHK. I really think you guys should make this awesome language work on Linux too. I did actually try it with WINE once (converted an ahk to exe), which didn't work. It's obviously a big project, but I really want to see it.

Ooh, the WINE thing gives me an idea. What if you partnered with WINE? They know what they're doing. Maybe they could add a thing that lets you use AHK? I dunno. Whatever. I just really wanna see that. Thanks!
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it :P
User avatar
Posts: 120
Joined: 18 Apr 2014, 19:05
GitHub: Chunjee

Re: We want AHK for Linux!

18 Dec 2018, 13:12

In the short term I would look at
https://pyautogui.readthedocs.io/en/latest/index.html or http://robotjs.io/
I think there was another purely python implementation but I can't find it again.

long term hopefully something emerges
Posts: 9
Joined: 18 Dec 2018, 16:27

Re: We want AHK for Linux!

22 Dec 2018, 16:08

If there were an AHK-like for *nix it would be a separate project. Also it would probably be tied to a specific window manager, XWindows is about as generic as you could get but for any advanced features you'd have to tie it to GNOME, KDE, etc. each of which would be their own project. That would be years of work for a project that most Linux users would probably not even want to use. The ubiquity of the command line diminishes interest in any hotkey-like programs, as most Linux users would use a combination of shell scripts, command-line programs, and aliases to achieve the same functionality you get from AHK.

I don't see why AHK would not run under WINE. You should try installing AHK with WINE and then run an AHK script with that installation, instead of trying to run a compiled script.
Posts: 1003
Joined: 22 Jan 2017, 19:37

Re: We want AHK for Linux!

24 Dec 2018, 09:32

@Hampoon, this is a topic of some interest to me, although I haven't recently pursued it.

AutoHotkey reportedly did run under Wine about 8 years ago and again as recently as 2015 (both with a Platinum rating). See this post. Unfortunately, I haven't been able to duplicate these results yet, although I have the same Linux Mint (17.1 Rebecca, x86_64 installed as one of the "Platinum" testers (the other used Ubuntu 5.04).

I tried with newer Wine versions without success. I could compile AutoHotkeyX (as it was called), but the binaries always crashed. The version of AHK reportedly used was 1.0.48, which can be grabbed here and other places . The Wine version used by the latest successful tester was 1.7.42; the "Hoary" user reported Wine 1.35.

There have been reports that newer Ubuntus (including the Mint version I use) have trouble with 32-bit Wine binaries, but unfortunately I stopped my investigations after trying many workarounds with newer Wine versions and ultimately failing with Wine 1.8 as well. I never did install 1.7.42.

I hope you have luck with it, and if you do, please share the results of your success :)
Posts: 731
Joined: 15 Jun 2015, 06:21

Re: We want AHK for Linux!

24 Dec 2018, 22:23

I'm of the present opinion that a possibly better way to get AutoHotkey on Linux, is to have a transpiler (source to source compiler) be made. Where AutoHotkey source code, not the C++ code of the interpreter, but the code of the script in the AutoHotkey language is translated to Pascal.

My reasoning on this is:

1) Pascal has the Free Pascal Compiler and can do cross-compiling

You can cross-compile Pascal to Windows, Linux, macOs, iOS, or Android.

2) Oddly, there is a lot of "syntax" or "linguistic" compatibility between the AutoHotkey language and Pascal.

3) Automation libraries and functions in Pascal, that can be used by a AutoHotkey to Pascal Transpiler

There appears to already be a lot of work done in this area by various Pascal programmers, who have even already made equivalent Automation commands similar to those in AutoIt and AutoHotkey in Pascal. In addition, you can translate various C or C++ libraries or functions to Pascal, and there appears to be a number of ways to do that. To include some tricks at the compiler level and directly linking libraries.

4) AutoHotkey Scripts could compile directly to Pascal binaries (after being "translated" via transpiler), that can run on different OSes.

Note- Mostly automation related commands would possibly need extra functions and libraries, where Flow Control (If, Else, Loop, etc...) or GUI syntax is already present in Pascal and simply needs to be "translated" to their corresponding equivalent.

Lastly, maybe an AutoHotkey Automation Application for Linux versus full transfer of the AutoHotkey C++ interpreter to Linux. Look at Pulover’s Macro Creator. It's an automation application that uses the AutoHotkey interpreter and language, but does not try to do everything. Possibly an Automation application that does various things in Linux and Android, using a subset of the AutoHotkey language and syntax (and augmented with Pascal), without it being a full cross over of the C++ interpreter and every AutoHotkey command of the Windows version.
Last edited by SOTE on 25 Dec 2018, 05:49, edited 1 time in total.
User avatar
Posts: 853
Joined: 12 May 2015, 02:10
GitHub: sl5net

equivalent for WindowsTitle - WindowsClass?

25 Dec 2018, 04:20

BTW is a Linux equivalent exist ? for

- WindowsTitles
- WindowsClass
- clipboard (nice to have)
- Send command (nice to have)

if that's the case it will be really interesting for me to think about working under Linux too.
User avatar
Posts: 4242
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: We want AHK for Linux!

25 Dec 2018, 04:33

A window manager is a part of the OS that handles the display of windows and uis in general.
In windows there is only one Window manager.
Linux has several window managers.
Recommends AHK Studio
Posts: 731
Joined: 15 Jun 2015, 06:21

Re: We want AHK for Linux!

25 Dec 2018, 05:42

It appears that there are command line options or tools to find this out, which could then possibly be fed to an automation tool, regardless of the Window manager used or that there are various ways to determine this despite the use of different Window Managers.

https://unix.stackexchange.com/question ... le-changes(Window Title Changes In Linux/Unix)

https://unix.stackexchange.com/question ... mmand-line(Get windows' titles using command line; Linux/Unix)

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 5 guests