Lurker News
Hello HN,

this is the first functional reimplementation of AutoHotkey [1] for Unix-like systems, as far as I am aware. Half the commands are still missing, but everything important is done, as I have worked a lot on it over the past two months. Converting scripts into stand alone binaries is also supported. Hope this will find some adoption eventually. :-) - This implementation focuses on v1.0-like classic syntax from 2004 (!). This is a significant subset of the popular current v1.1 syntax from Windows (AHK_L). The reason this does not (yet?) target the full Windows spec is how complex it is. Notably, there's also another ongoing project which targets v2 called KeySharp [2].
If you are not aware of what AHK is, it is an easy but capable scripting language for automation and Hotkeys, and all sorts of visual things like GUIs.
If you want to learn more, there plenty of info on the repo, the docs html, and there's an active AHK Discord too, and I am personally also checking the forums and HN of course.
[1] https://www.autohotkey.com/ [2] https://bitbucket.org/mfeemster/keysharp/

Comments (183) 43 threads

Earlier comments
chrismorgan6 replies#
Isn’t it a bit late to do something like this tied to X? I get the impression almost all distributions now default to Wayland. This feels like something that would have been good a decade ago, but is too late now.

(Mind you, this would be a good deal harder to implement in Wayland, where possible at all, since Wayland is predicated around a security model where this kind of thing is deliberately not supported. You can either go with something compositor-specific, and I don’t know if this is possible for all compositors, though I get the impression that it should be possible for at least wlroots; or work more the way ydotool does, where possible, in basically providing a fake input device.)

yjftsjthsd-h1 reply#
I mean, as you note, Wayland almost certainly can't provide this kind of functionality by design. It offers some ways to fake input, but AFAIK no way to hook/listen to input events without hoping that each compositor adds a way to do so. In contrast, X11 trivially enables read and write access to input events, as well as the ability to intercept input and rewrite it before applications see it. Also, while many distros now ship Wayland as the nominal default, last I'd seen it was actually used by a minority of users compared to Xorg (if we exclude ChromeOS, which seems reasonable for this conversation).
smartmic1 reply#
> Also, while many distros now ship Wayland as the nominal default, last I'd seen it was actually used by a minority of users compared to Xorg

You touched a good point. The one and only metric to measure success in software is the number of active users. However, i do not know of any statistics Xorg vs. Wayland users. Personally, i have no reason to switch away from X11. In contrary, it was and is a loyal companion now already for decades. I trust the Lindy effect that X11 will stay relevant for a very long time. So kudos for the OP for creating this!

jhoechtl2 replies#
So you are not using fractional scaling which is reason enough to switch to Wayland.

Continue this thread — 2 replies

jcelerier#
Reading that thread is infuriating and still full of the ridiculous idea that every single use case should be defined through specific protocols
phil294#
Wayland will be an interesting challenge, but I think there's still plenty of time before that happens.

If we figure out that this kind of automation is impossible on Wayland, I think it should still be possible to hook into the raw keyboard events with kbd and such, no? Requires root though.

yyyk#
>Isn’t it a bit late to do something like this tied to X?

At the moment, Wayland is used only by a minority of users, and most are still on X11. Sure, distros may often default to Wayland, yet almost no distro has switched the user's default upon upgrading.
Most users aren't new users or installing on new systems, and even for new users X is occasionally still default (e.g. every existing BSD, some KDE distros).
I estimate it's another 5 years before another new computer cycle and Wayland maturing will make X less relevant. 15-25-more years before we could even consider removing support.

t-32 replies#
Wayland has had very little traction outside of RH and other corp-heavy groups. It didn't work for too long, now it works and still requires an X server to do anything useful while having less applications, worse features, higher resource usage in the available systems. I haven't seen anything to motivate me to try to switch since the "new shiny" wore off a decade or so ago.
chrismorgan#
I used i3 on older laptops, and decided to try switching to Sway when I got my current laptop 16 months ago. I’ve switched back to i3 on it on a few occasions for screen sharing in Zoom, and wow, I’d forgotten how bad the tearing is, and how not-great the management of inputs and outputs (though this is unlikely to affect full desktop environments like GNOME and KDE), and how annoying it is to not be able to use my XF86AudioMicMute key because its key code is 256 (it was a pain to get working in Sway, requiring xkb_file with a manually-tweaked keymap, but as far as I can tell it’s simply not possible under Xorg which has a hard limit of 255). Plus scaling simply doesn’t work at all well in X/i3, to say nothing of flat-out not supporting mixed scaling, whereas it all just works in Sway (the only apps I have to tweak are ones run via Xwayland, which sometimes but don’t always get it right out of the box).
freedomben1 reply#
> I haven't seen anything to motivate me to try to switch since the "new shiny" wore off a decade or so ago.

I get some terrible screen tearing on X, especially when using OBS. On Wayland it's solid. With X/Wayland the best thing it can do is be invisible.

t-31 reply#
I haven't seen screen tearing anywhere in more than a decade, so that doesn't have much weight with me, but I can see how it could be an issue for video editing (if OBS is what Google suggests it is). Now I'm interested in why X and Wayland would be different - screen tearing seems like it would be at a lower level (mesa?) than the display server? I don't understand how any of a modern graphics stack actually works though.

Continue this thread — 1 reply

nooyurrsdey3 replies#
Love the project but I really wish projects (especially linux projects) would include a "plain english" description of what this does at the top. Like, even one sentence.

1. Not everyone knows what AutoHotkey is and what it does. I had to google it.
2. Not everyone speaks english. Diving into a description that includes words like "fault tolerant, extensible, high availability" so infuriatingly confusing.

frostwarrior2 replies#
I don't think that (2) is OP's fault.

Look the words up in a dictionary. It's ok not to know and to learn but you shouldn't expect everyone to adapt to your lack of knowledge.

InCityDreams2 replies#
....explain it like I'm 5 years old?
capableweb1 reply#
If everyone wrote software to be used by 5 years old without any interest in looking up things they don't understand (yet) themselves, we'd never move the field forward.

Continue this thread — 1 reply

Vrondi#
Dictionary is good for learning words.
ttnj9ZKCVQAAbxK1 reply#
A dictionary probably won't give you a useful definition for most of those terms. They're jargon.

But then again I would add (3) they're just buzzwords that don't actually tell you anything...

OJFord#
Perhaps not HA, but 'fault tolerant' and 'extensible' are pretty apt.
phil2941 reply#
1. Thank you for the suggestion. I added the one-liner description from the Windows website to the top of the Readme.

2. Those words aren't in the Readme so I'm a bit confused. I guess these were just examples though. I am not a native speaker either though... if you really think there's uncommon words to be found, I would welcome a PR.

dotancohen1 reply#

  > I added the one-liner description from the Windows website.
Bad idea, you don't need an infringement case. Try this instead: "An easy to learn language for automating your Linux computer". People who don't know what AHK is don't care that this project is a port of it, so no need to mention that in the description.
krsdcbl#
tbh your suggestion would confuse me as well, i think the scope or better said usp of ahk is more specific, and the proposed description could very well mean bash or other comparable tools
boredtofears1 reply#
#2 is pretty common software lingo. If you’re esl you definitely are going to want to look that one up.
throwamon1 reply#
Pretty ironic to write "esl" instead of the expanded form.
boredtofears3 replies#
what's ironic about it?

Continue this thread — 3 replies

theonemind3 replies#
Bit of a tangent/slightly off topic:

how do HNers make Windows not evil/terrible? Like, it tries to force you into creating a Microsoft account to install Windows, I hear it has ads in the OS, forces reboots when you don't want them, and appears to generally treat its users with contempt and as a resource to exploit.
Do you need an MSDN subscription to get LTSC? Any third-party tools that try to fix the horror show?
Such a shame to have a solid platform run for evil motives.

stjohnswarts1 reply#
- chocolatey for installing apps (most of what I need anyway)

- WSL for command line stuff, python, rust
- bleachbit for clean up of files, be careful and pay attention obviously
- Immediately switch over to firefox (from Edge) and have brave installed as a backup
- I just don't use the microsoft store at all unless I need to
- malwarebytes for nightly scans, avira free as a virus program instead of defender
- Shutup10++ to turn off most of the privacy invasion antifeatures of windows
- Make notepad++ or gvim default editor
- You can delay or turn off updates in the settings. I just live with the reboots though. I have a fast machine and most programs will have session save features anyway.
That's mostly enough to make it a decent environment.

majkinetor1 reply#
You can now use winget to install ms store tools via CLI.
stjohnswarts#
I've used winget to fetch a couple of things (because of windows support pages). I still use choco as my default though. Unless someone shows a huge advantage for winget then I think I'll continue on. I like using programs that aren't under Microsoft's umbrella if I can. Much the same way as avoiding google and amazon.
selfhoster11#
When it comes to Windows 10, I basically "pave over" as much of the shell as possible. This includes replacing the Start menu with Classic Shell/Open Shell, potentially replacing the taskbar with RetroBar [0], erasing as many UWP apps (Cortana and Edge included) as possible from the system, basically anything goes.

For things that are relatively useful to keep like Windows Explorer, I try the numerous registry tweaks that remove features I don't like (for example, OneDrive integration). Couple this with Tron and similar scripts.
Installing an LTSC edition would obviously be nice, but it's hard and expensive to get to get (see [1] - the general consensus seems to be that you need to go through a VAR, and then buy an LTSC license alongside some cheap shopping basket fillers to get above the minimum number of licenses limit). When it's available, it makes the above "paving over" process much easier than a retail/pro edition.
[0]: https://github.com/dremin/RetroBar
[1]: https://answers.microsoft.com/en-us/windows/forum/all/how-do...

All comments shown.