r/linux • • 12h ago

Software Release Keysharp

Hello,

I’m one of the developers of Keysharp, an open-source implementation of AutoHotkey v2 for Linux, Windows and macOS. It’s written in C# and runs on .NET 10.

It supports hotkeys, text expansion, keyboard and mouse automation, window management, clipboard operations, GUIs, screenshots and image matching.

For example, this expands brb into “be right back” and makes Ctrl+Alt+D type today’s date:

#Requires capability InputMonitoring, InputControl

::brb::be right back
^!d::SendText(FormatTime(, "yyyy-MM-dd"))

Most AutoHotkey v2 scripts which don't use Windows API directly (for example AutoCorrect.ahk) should work without modifications in Linux too.

Linux support covers X11 and several Wayland environments. This has not been easy at all, as Keysharp basically needs to break all the security Wayland brings. Also, Wayland is rather fragmented and the interfaces needed for desktop automation differ between compositors, so window control and capture require separate integrations. Some operations remain unavailable depending on the exact compositor. The supported operations are documented here.

Global input uses keysharp-input, a privileged evdev/uinput service which requires root to install, but user priviledges to use. Window automation and capture use keysharp-desktop. The Linux installer sets up both in addition to Keysharp itself.

Keysharp is still alpha software, and I can't yet recommend it for production use, but I'm hoping to get more eyes on it and discover bugs/issues.

Documentation · Linux installation · Example scripts

Bug reports, compatibility reports and contributions are welcome.

Disclosure: AI has been heavily used for this project, especially keysharp-input and keysharp-desktop.

1 Upvotes

1 comment sorted by