3 ms·
It's a simple and valid question, but I'm afraid the answer is rather nuanced. Most things you do with AHK are also possible on Linux in general, but in a much
by phil294 4y ago
It's a simple and valid question, but I'm afraid the answer is rather nuanced. Most things you do with AHK are also possible on Linux in general, but in a much more fragmented way. AHK (in its complete form) unifies most functionality of xbindkeys, xdotool, GUI creation (no common tool I am aware of), popups, wmctrl, unix tools like echo/cp/, assistive technology, window manager tools, grabc, and many more, out of which some aren't even possible without sophisticated programming like Hotstrings (auto-replace while typing), ImageSearch, StatusBarGetWait and all those things. It also ships with many common programming language features such as math operations, and brings its own equivalents to unix tools like FileCopy and FileAppend.
Then there's also AHK's ease of use, which also makes it appealing to non-programmers or beginners. Every piece of logic (even loops etc) is basically encapsulated in a single-word command instruction, almost like ASM, but for humans. You create GUIs with `Gui, add, button`, maximize windows with `WinMaximize Firefox`, hotkeys with `a::MsgBox You pressed a` and so on, and all of that with basically no code. I'd recommend you take a short look at the AHK documentation, such as the intro or alphabetical list of commands. It gives you an idea of what you can do with it.
Besides, the entire language is visually oriented (and so is this implementation of mine): You create, edit, run, reload, and (optionally) compile scripts usually not by using terminal, but by context menus. This makes it far more accessible for people migrating from Windows, apart from the fact that you can apply your acquired AHK skills from Windows.
Finally, I have found that the existing Linux automation-specific tools (which mostly boils down to xdotool) are, in comparison to Windows AHK, inferior. Getting Windows-like automation functionality on Linux is quite a task. The main difference is that very often, you just don't need Window or Hotkey automation on Linux, because most programs are CLI-first, thankfully.
- llanowarelves 4y agoAwesome comment. It shows a failure of the "Unix Way" imo. Everyone hand-rolling their homebrew combination of 20 different tools together is sometimes not the best way to go. We can look at Docker, Kubernetes, Dropbox(etc), desktop environments, and many other things to see that people greatly value almost the complete opposite approach, within some sweet-spot.
- throw10920 4y agoThis is exactly right. The reason that no nontrivial popular program exists written using shell scripts is because the Unix Way of gluing together separate programs just isn't a sustainable software development methodology that leads to nontrivial useful software.
- aruggirello 4y ago> GUI creation (no common tool I am aware of) You can create simple GUIs straight from bash too - take a look at zenity (I'm aware it's not the only option BTW)