We want AHK for Linux!

Propose new features and changes
Hampoon
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
Chunjee
Posts: 1397
Joined: 18 Apr 2014, 19:05
Contact:

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
anomalocaris
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.
burque505
Posts: 1731
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 :)
Regards,
burque505
SOTE
Posts: 1426
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
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

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
nnnik
Posts: 4500
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
SOTE
Posts: 1426
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)
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: We want AHK for Linux!

20 Nov 2019, 05:05

https://github.com/sl5net/AutoHotKey4Linux

# AutoHotKey4Linux version 0.00000001 Alpha
AutoHotKey wrapper, for using AutoHotKey in Linux

using AutoKey, AutoHotKey, wine

You need to install first:

wine for Linux and
AutoHotKey and
AutoKey for Linux
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: We want AHK for Linux!

20 Nov 2019, 09:40

@SL5, I look forward to trying this out.
Can you please list the version of 'wine' you use, the AutoHotkey version you use, and which version of AutoKey you use?
It would be useful to know what Linux distro you use as well - wine versions seem to vary quite a bit among them.
Thanks very much.
Regards,
burque505
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: We want AHK for Linux!

20 Nov 2019, 12:22

burque505 wrote:
20 Nov 2019, 09:40
@SL5, I look forward to trying this out.
Can you please list the version of 'wine' you use, the AutoHotkey version you use, and which version of AutoKey you use?
It would be useful to know what Linux distro you use as well - wine versions seem to vary quite a bit among them.
Thanks very much.
Regards,
burque505
Logbook of a last successful test.
https://github.com/sl5net/AutoHotKey4Linux/commit/988525369dfe4591dbbe4e231308fb181cd5f9a1
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: We want AHK for Linux!

20 Nov 2019, 12:47

Thanks!

Code: Select all

wine-4.18
autokey-gtk 0.95.7
Manjaro Linux 18.1.3
That should get me started.
Regards,
burque505
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: We want AHK for Linux!

20 Nov 2019, 15:38

burque505 wrote:
20 Nov 2019, 12:47
Thanks!

Code: Select all

wine-4.18
autokey-gtk 0.95.7
Manjaro Linux 18.1.3
That should get me started.
Regards,
burque505
Great :) I recomand using this: https://github.com/sl5net/AutoHotKey4Linux/blob/master/read_key_title_class_from_cllipboard_v3.ahk

BTW i searching an editor in linux. ahk-studio dont run and VS code maybe but not an my machine at the moment.
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: We want AHK for Linux!

22 Nov 2019, 09:53

Maybe people should revisit IronAHK. It looks to be the cleanest solution and there is already a significant amount of code. And there seems to be a lot of C# and AutoHotkey interactions over the years, so a fully C# (C family language) solution shouldn't be that much of a leap.

IronAHK website on wayback (https://web.archive.org/web/20131213195521/http://www.ironahk.net/)
IronAHK on GitHub- https://github.com/Paris/IronAHK

It appears that for the last version of IronAHK, people were running it on Linux and Macs. It definitely appeared to be usable on Windows.
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: We want AHK for Linux!

22 Nov 2019, 16:53

SOTE wrote:
22 Nov 2019, 09:53
Maybe people should revisit IronAHK. It looks to be the cleanest solution and there is already a significant amount of code. ...
i visited it but not tested. may there is a misunderstanding.
AutoHotKey4Linux is just a Wraper to normal AutoHotKey ( https://github.com/sl5net/AutoHotKey4Linux/blob/master/README.md ).

SOTE wrote:
22 Nov 2019, 09:53
... IronAHK website on wayback (https://web.archive.org/web/20131213195521/http://www.ironahk.net/)
IronAHK on GitHub- https://github.com/Paris/IronAHK
... people were running it on Linux and Macs ..."
Thanks we/i should look of its helpful to install it at the same time. may it helps AutoHotKey4Linux. Every solution is welcome :)

At the moment the keystrokes arrive at the Autohotkey like this: Key.esc key = 'k' key = Key.ctrl etc. ( <AutoKey:active_title= ...,active_class=..,press_key=Key.ctrl> <AutoKey:active_title= ...,active_class=..,release_key=Key.ctrl> )


Maybe someone wants to write a converter now?
sobuj53
Posts: 55
Joined: 19 Mar 2015, 16:08

Re: We want AHK for Linux!

27 Nov 2019, 12:40

@SL5 Hey, so is it possible to use AHK in linux? To be honest AHK is the only think I miss since I switched from Windows. I really wish that there would be a alternative/similar thing in linux too.
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: We want AHK for Linux!

28 Nov 2019, 01:50

sobuj53 wrote:
27 Nov 2019, 12:40
@SL5 Hey, so is it possible to use AHK in linux? To be honest AHK is the only think I miss since I switched from Windows. I really wish that there would be a alternative/similar thing in linux too.
Actually, I do not have the time. but it is not difficult for you to do it yourself ==> https://github.com/sl5net/AutoHotKey4Linux/blob/master/read_key_title_class_from_cllipboard_v3.ahk#L41 . Or you pay me a few on Freelancer so i could do it little fast/earlier? You just have to parse the keystrokes that arrive as a string into AutoHotkey. I already described that a bit. I'm also very keen on getting freelancers to get some good reviews right now.
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: We want AHK for Linux!

28 Nov 2019, 12:54

In theory, using IronAHK should be possible still. There is a downloadable .msi for IronAHK which works. Both 64-bit and 32-bit versions are available. The documentation is sparse and confusing, but some things work. If I can make it to a Linux box this weekend I'll try to compile it. Problems with that have been reported :evil:
Here's an example script after installation on Win7 Pro 64-bit:

Code: Select all

Gui("Add", "Edit", "w400 h400")
gui("Show")
return
edit.JPG
edit.JPG (14.45 KiB) Viewed 35182 times
burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: We want AHK for Linux!

28 Nov 2019, 13:18

A blast from the past . . . sigh ...
wat..JPG
wat..JPG (51.7 KiB) Viewed 35171 times
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: We want AHK for Linux!

28 Nov 2019, 13:21

burque505 wrote:
28 Nov 2019, 12:54
In theory, using IronAHK should be possible still. ... If I can make it to a Linux box this weekend I'll try to compile it. Problems with that have been reported :evil:
Here's an example script after installation on Win7 Pro 64-bit:

Code: Select all

Gui("Add", "Edit", "w400 h400")
gui("Show")
return
edit.JPG
Okay great then you we could maybe use both together? Iron and ahk4linux? Or can iron even read the window names and read keyboard without the help of Python? Or you only mix it together with the Python Part. Is it better to install Iron than the normal Autohotkey over wine?
What is the advantage of using Iron instead of the normal Autohotkey? What can Iron what Autohotkey can not do about wine?

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 20 guests