TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: AutoHotkey for Linux

500 点作者 phil294超过 2 年前
Hello HN,<p>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 <i>subset</i> 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&#x27;s also another ongoing project which targets v2 called KeySharp [2].<p>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.<p>If you want to learn more, there plenty of info on the repo, the docs html, and there&#x27;s an active AHK Discord too, and I am personally also checking the forums and HN of course.<p>[1] <a href="https:&#x2F;&#x2F;www.autohotkey.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.autohotkey.com&#x2F;</a> [2] <a href="https:&#x2F;&#x2F;bitbucket.org&#x2F;mfeemster&#x2F;keysharp&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bitbucket.org&#x2F;mfeemster&#x2F;keysharp&#x2F;</a>

41 条评论

themodelplumber超过 2 年前
You did this? Nice job!<p>&gt; Please also check out Keysharp, a WIP fork of IronAHK, another complete rewrite of AutoHotkey in C# that tries to be compatible with multiple OSes and support modern, v2-like AHK syntax with much more features than this one. In comparison, AHK_X11 is a lot less ambitious and more compact, and Linux only.<p>Fascinating, lots to check out here. Thank you.<p>BTW this kind of work falls into poweruser tools IMO, which is an important area for cultivation of Linux Desktop focus. Traditionally in the Linux community this has been more of a distro-maintainer&#x27;s support choice (offer poweruser tweaks and tools, or not) so it&#x27;s always nice to see new distro-independent, non-dev-poweruser options coming into being.
BiteCode_dev超过 2 年前
I see the benefit in this, having one script that works everywhere.<p>It&#x27;s also good to know linux has autokey (<a href="https:&#x2F;&#x2F;github.com&#x2F;autokey&#x2F;autokey" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;autokey&#x2F;autokey</a>) for the same result. The name is close, but it&#x27;s a different project.<p>It&#x27;s not compatible with autohotkey, but you can script using python. I used it to enter dates, emails and automatize dynalist.io actions.
评论 #32656818 未加载
评论 #32659894 未加载
评论 #32655543 未加载
评论 #32660928 未加载
endymi0n超过 2 年前
Nice! I used to love AHK to death, incidentally it also got me my first paid programming job.<p>It‘s about the only software I dearly missed after switching to Mac, but recently I found Hammerspoon and couldn‘t have been happier.<p>Yep, Lua is a bit weird and exotic, but hey, so is AHK. In the end, you trade in some of AHKs terseness for better modularity and compatibility with existing packages.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;Hammerspoon&#x2F;hammerspoon" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Hammerspoon&#x2F;hammerspoon</a>
评论 #32662950 未加载
评论 #32659888 未加载
评论 #32659426 未加载
评论 #32660342 未加载
geocrasher超过 2 年前
AHK is GOLD for me. Power user? Sure. But it ties me to Windows only, and so I&#x27;m VERY keen to see a version for another OS. AutoKey failed miserably in my testing, and I have so much tied directly to AHK that I&#x27;m okay with choosing Windows to run it. There&#x27;s a lot of other things that are Windows-only for me, so it&#x27;s not a big deal. I actually LIKE W10 and W11. But it&#x27;s great to have options!
评论 #32657644 未加载
account-5超过 2 年前
Like another commenter I learned to program with AHK. I&#x27;ve used it for automating dispetate software that didn&#x27;t natively talk to each other, automate MS Office tasks via COM objects (think VBA), make use of DLLs for certain tasks, and obviously for text expansion and replacement.<p>I&#x27;ve always looked for software similar for Linux but nothing comes close.<p>The documentation is second to none as well.<p>Anyway I&#x27;m really happy to see this, well done I hope it all goes well.
jerrygoyal超过 2 年前
I also compiled a list of most useful AHK scripts <a href="https:&#x2F;&#x2F;gourav.io&#x2F;blog&#x2F;autohotkey-scripts-windows" rel="nofollow">https:&#x2F;&#x2F;gourav.io&#x2F;blog&#x2F;autohotkey-scripts-windows</a>
评论 #32660785 未加载
infogulch超过 2 年前
I learned programming with AHK back in the day.<p>One neat feature is that you can bundle a bunch of scripts with the runtime into a single file binary for easy distribution. If AutoHotkey runs on multiple operating systems, maybe combining this with cosmopolitan libc into an &#x27;αcτµαlly pδrταblε εxεcµταblε&#x27; would let you bundle a script and use it across different OSes. That&#x27;d be pretty fun.
评论 #32654942 未加载
评论 #32654725 未加载
keybored超过 2 年前
The state of GUI automation and keyboard remapping on Linux is pretty meh. AutoHotkey seems pretty bespoke but it might be the best option right now.
评论 #32658270 未加载
yewenjie超过 2 年前
I have never used AHK before. Can someone please explain to me what _could_ it bring to the Linux world given that scripting is much easier in general?
评论 #32654501 未加载
评论 #32654347 未加载
评论 #32654778 未加载
评论 #32654474 未加载
评论 #32655246 未加载
评论 #32655782 未加载
评论 #32657933 未加载
评论 #32654331 未加载
评论 #32656428 未加载
评论 #32657309 未加载
评论 #32654343 未加载
评论 #32658182 未加载
评论 #32654234 未加载
评论 #32657899 未加载
mathverse超过 2 年前
I like seeing languages like Crystal in the wild! Good job.
ricopags超过 2 年前
I don&#x27;t have a linux machine handy but I wonder if this can run the excellent Lintalist[0]. I use it daily in my support work and I can&#x27;t imagine ever getting away from it (also a huge fan of Clipjump[1])<p>[0]<a href="https:&#x2F;&#x2F;lintalist.github.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lintalist.github.io&#x2F;</a> [1]<a href="http:&#x2F;&#x2F;clipjump.sourceforge.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;clipjump.sourceforge.net&#x2F;</a>
评论 #32656689 未加载
stavros超过 2 年前
I&#x27;ve been looking for something that can recognize the mute button in call software (Zoom, Meet, etc) and click it, but everything I&#x27;ve found seems to do image detection.<p>I understand that running in a browser makes things hard, but is there a better method? I guess I could write an extension for Meet and Jitsi, but Zoom would then be the odd one out.
评论 #32657026 未加载
评论 #32672523 未加载
评论 #32656426 未加载
评论 #32656422 未加载
评论 #32656215 未加载
pomatic超过 2 年前
Perhaps this is the wrong place to ask, but it seems relevant. Having skimmed the documentation I can&#x27;t see any options around automating selection&#x2F;clicking of dialogue box buttons?<p>I have a user who has limited dexterity, and the ability to have a macro that selects&#x2F;clicks on (modal?) dialogue box buttons based on their label (OK&#x2F;Cancel etc.) would be a life saver for them. (A pre-determined set of keystrokes based on knowledge of the tab order would not work - this needs to be generic, based on the button text for my application.)<p>As things stand, I&#x27;m looking at hacking a video capture device and openCV together, but I can&#x27;t help but think this must be a solved problem and I just have poor google-fu?
评论 #32655876 未加载
评论 #32656126 未加载
评论 #32655779 未加载
评论 #32655271 未加载
评论 #32658088 未加载
artificialLimbs超过 2 年前
I used to work as a photographer at a car dealership. I was tasked with taking pictures of all the cars that came to the lot, and uploading them to our web site. I would take pictures in the afternoon, taking 1-2 hours. In the morning I would clock in and then go to a coffee shop for a few hours to let AHK do all the heavy lifting of uploading the images to the 3rd party clunker of a back end website. I would have definitely installed and used Linux if this was around then.<p>Awesome work.
guilhas超过 2 年前
Good work<p>I have used AHK a lot and looked for a Linux alternative in the past, like AutoKey, Actiona... which did not felt as good<p>But nowadays I think I prefer the &quot;Linux way&quot; tools, the bulk can be done with: sxhkd, bash, zenity, xdotool, expanso...<p>AHK is all-in-one personal automation tool, very useful in Windows, a single tool with a unified language<p>Linux has a CLI tool for everything, more disperse, different implementations, but easier to re-use modules elsewhere<p>Still choice is good
评论 #32661416 未加载
RMPR超过 2 年前
Shameless plug <a href="https:&#x2F;&#x2F;atbswp.com" rel="nofollow">https:&#x2F;&#x2F;atbswp.com</a> not as powerful, but good enough for quick hacks.
Vivtek超过 2 年前
Oh, this is <i>sweet</i>. Back in my Windows days I relied heavily on AHK for hotkeys as well as some glue for various tasks, and while I&#x27;ve managed to figure out most of the glue items on Linux (which I&#x27;ve used for the past five years or so), I&#x27;ve always missed hotkeys, for which I&#x27;ve never found a really good AHK-like solution.<p>We are truly living in wondrous times.
ivanjermakov超过 2 年前
In case you&#x27;re looking for QMK[1]-like capabilities for regular non-programmable keyboards - check out kmonad[2]<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;qmk&#x2F;qmk_firmware" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;qmk&#x2F;qmk_firmware</a><p>[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;kmonad&#x2F;kmonad" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kmonad&#x2F;kmonad</a>
Vanderson超过 2 年前
Thank you! I haven&#x27;t tried it yet, but this was one of the only things that I sorely missed when I went from Windows to Linux.
marcodiego超过 2 年前
Does it work with Wayland?
评论 #32655160 未加载
entropie超过 2 年前
Nice.<p>I installed autohotkey on windows because I wanted to duplicate subcommands that I use with linux for ages (xmonad has it more or less built in)<p><pre><code> meta m n # next track meta m space # play&#x2F;pause </code></pre> Was relatively easy to implement, after i got help in r&#x2F;autohotkey
评论 #32739123 未加载
tke248超过 2 年前
Does autohotkey have keyboard and mouse recording function when I first learned about scripting 20 years ago Winbatch had that function which took a non-programmer who just wanted to speed up repetitive tasks into an entry level programmer after a few weeks of use.
georgewsinger超过 2 年前
Does this support converting new keys into new modifiers? IIRC AHK allows you to do things like:<p><pre><code> - If CapsLock is pressed, treat it as a new modifier. - If CapsLock is released, send &quot;ESCAPE&quot;. </code></pre> If so, that would be swell.
评论 #32739140 未加载
arthurofcharn超过 2 年前
Wonderful news. Now we have hope of convincing Tom Scott to join the winning team.
评论 #32659958 未加载
评论 #32659779 未加载
thecrumb超过 2 年前
The <i>one</i> thing I miss from Windows is AHK. Thanks for posting this!
评论 #32739146 未加载
beering超过 2 年前
It looks like the calls needed to control a GUI application are not yet implemented. Does anyone know of a Linux tool that can do GUI automation? E.g. find window A, click menu B, click menu item C…
评论 #32655306 未加载
评论 #32654503 未加载
评论 #32654502 未加载
neverrroot超过 2 年前
One of the only things I truly missed under Linux. Much can be solved using various tools such es AutoKey, XbindKeys+Guile etc. but nothing comes close to what AHK was capable of under Windows.
sjducb超过 2 年前
Nice I really missed AHK when I moved away from windows
xtracto超过 2 年前
This is so great! I have fond memories of AutoHotkey when I used Windows. It has just the right balance between scripting requirements and features.
iafiaf超过 2 年前
AHK is excellent; created a fishing bot during the hardcore WoW raiding days (Stonescale eel for Flask of Titans, anyone?)
boomskats超过 2 年前
Does anyone know of a stable way to implement SpaceFN under X?<p>Apologies for the hijack, but this thread feels like the right place to ask.
评论 #32655610 未加载
CGA11超过 2 年前
AHK is one of the things I miss from my Windows days (along with Macrium Reflect).
jrm4超过 2 年前
Advantages over xbindkeys?
评论 #32654322 未加载
woodruffw超过 2 年前
Nice work! And thanks for the x_do.cr shoutout :-)
chillpenguin超过 2 年前
Anyone know of a comparable program for macOS?
评论 #32656293 未加载
评论 #32656100 未加载
评论 #32659384 未加载
评论 #32658054 未加载
IceWreck超过 2 年前
I think the reason something like this doesn&#x27;t exist for Linux is that most Linux users prefer to use a more powerful language to create their own scripts instead.
sanroot99超过 2 年前
For Linux i used ,xkeybindrc and xdotools
paulryanrogers超过 2 年前
Wayland support when ~Civvie~?
评论 #32660245 未加载
chrismorgan超过 2 年前
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.<p>(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 <i>impression</i> 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.)
评论 #32654565 未加载
评论 #32657824 未加载
评论 #32654847 未加载
评论 #32656911 未加载
评论 #32655339 未加载
评论 #32655061 未加载
评论 #32654641 未加载
nooyurrsdey超过 2 年前
Love the project but I really wish projects (especially linux projects) would include a &quot;plain english&quot; description of what this does at the top. Like, even one sentence.<p>1. Not everyone knows what AutoHotkey is and what it does. I had to google it.<p>2. Not everyone speaks english. Diving into a description that includes words like &quot;fault tolerant, extensible, high availability&quot; so infuriatingly confusing.
评论 #32654655 未加载
评论 #32654736 未加载
评论 #32654752 未加载
theonemind超过 2 年前
Bit of a tangent&#x2F;slightly off topic:<p>how do HNers make Windows not evil&#x2F;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&#x27;t want them, and appears to generally treat its users with contempt and as a resource to exploit.<p>Do you need an MSDN subscription to get LTSC? Any third-party tools that try to fix the horror show?<p>Such a shame to have a solid platform run for evil motives.
评论 #32656884 未加载
评论 #32661514 未加载
评论 #32656870 未加载
评论 #32657319 未加载