AHK or something close on Linux?

Discuss other programming languages besides AutoHotkey
MindCaged
Posts: 19
Joined: 19 Jun 2014, 12:33

AHK or something close on Linux?

19 Jan 2024, 22:44

I wasn't sure where to look for this. I'm a long time windows user and somebody who fell in love with AHK for several years now and have made an extensive script which I use regularly. I recently have been getting annoyed with the latest windows and decided to give Linux a try, specifically Linux Mint XFCE currently, but was very heartbroken to find out that AutoHotkey just doesn't really work on Linux from what information I can find by googling it. Is there a version of it that's mostly compatible? When I google it I find there's a few similar things that are apparently much more basic, or I keep seeing posts saying to learn python scripting and that I should be able to do stuff with a python script.

My main requirements I can think of just for stuff I use regularly, in no particular order:
1. Be able to block CapsLock by default so I can use it as a macro modifier key. For example, I have a rapid clicker that I can use whenever I want by just holding CapsLock when I click along with that majority of my macros being a combination of CapsLock and something else. Along with being able to adjust the clicking speed with the mouse wheel.
2. Being able to send keypresses/clicks to programs, bonus points if I can do so while the program is inactive, I don't know how the linux event system works, I know in Windows there's window messages, but I don't know how it works on Linux.
3. I'd really love if I could easily setup popup menus as they are great at making something that's interactive with feedback without having to create a whole GUI. I have a somewhat elaborate one with all sorts of functions I can perform on the contents of the clipboard, such as case conversion, base64 en/decode, URL en/decode, converting the contents of the clipboard to text, like if you copy a file you can paste the path. A few only occasionally useful functions like converting to ascii codes or binary, which occasionally are useful on forums as some people like to use binary/ascii conversion as a way of somewhat hiding messages, in my case it's usually funny stuff hidden in stories.
4. I suppose being able to move/resize/control windows would be nice, but those functions /might/ be native depending on the distro, I have to look through the key-binding options in the OS settings.
5. I am really curious if the linux system would let you both know which keyboard each event came from as well as have the ability to selectively block it, those seem to be mutually exclusive on windows.
6. If I do have to learn python, I'm going to have to learn how to do timers/sleeps.
7. Hotstrings would be great.

There's probably other stuff I'm not thinking of, but I think those are my most common uses.

[Mod edit: Deleted a duplicate of this topic.]
ahk7
Posts: 575
Joined: 06 Nov 2013, 16:35

Re: AHK or something close on Linux?

20 Jan 2024, 10:51

1. AHK_X11 (Requires X11, does not work with Wayland yet) https://github.com/phil294/AHK_X11
2. Not ready for linux yet but keep an eye on Keysharp viewtopic.php?f=80&t=77248

Install Wine if not already present and try AutoHotkey.
User avatar
xMaxrayx
Posts: 164
Joined: 06 Dec 2022, 02:56
Contact:

Re: AHK or something close on Linux?

14 Feb 2024, 11:06

you better use python and write your library other than maybe sue AHK in VMbox, personally i will buy used laptop if i want AHK for work environment.
will at least python is easy to learn the issue is not all library are native for linux and they dont get updated.
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/
User avatar
mfeemster
Posts: 104
Joined: 24 Apr 2020, 18:30

Re: AHK or something close on Linux?

16 Feb 2024, 02:40

As @ahk7 noted, my project Keysharp has the aim of being able to run on linux, but has not yet done so.

The reason this has never been done is because the AHK code is very Windows specific, with API calls all throughout.

This is part of the reason Keysharp took the route of using C#. We can use things like Winforms to abstract away some of the OS specific calls. Winforms is implemented on linux in Mono.

However, even outside of Winforms there are many API calls. We'll need to find the equivalent of them on linux to make the behavior the same.

The roadmap we have is to get it working fairly well on Windows first. By fairly well, I mean all of the functionality of the AHK V2 spec, with some minor caveats.

We currently have reached that point and I am taking a break from the project.

When I resume in a few months, I'll begin looking into the linux part.

Some of the code will not need any modifying, other parts will need substantial re-design.

The reason you've had trouble finding anything which does what you want, is that the code is extremely complex and the library of all AHK V2 functions is large. For perspective, Keysharp originally started out as a project on these forums called IronAHK. It ran sporadically from 2010 to 2015. I picked it up in spring of 2020. So we are coming up on almost nine years of development just to get a Windows version of it working. It's going to be at least another year to get it working somewhat on linux. Probably another year after that to get it working well.

The new thread for the project is here: viewtopic.php?f=97&t=125220
geek
Posts: 1052
Joined: 02 Oct 2013, 22:13
Location: GeekDude
Contact:

Re: AHK or something close on Linux?

17 Feb 2024, 08:31

I maintain a list of tools like AutoHotkey across the major platforms here
User avatar
mfeemster
Posts: 104
Joined: 24 Apr 2020, 18:30

Re: AHK or something close on Linux?

18 Feb 2024, 19:33

Thanks @geek, I see Keysharp in there. When it comes time to do the linux part, I will definitely inspect the code to see how those other projects were able to implement similar behavior in X11/linux.

Return to “Other Programming Languages”

Who is online

Users browsing this forum: No registered users and 82 guests