This documentation set accompanies the AutoHotkey v2.0.26 Linux port (MonoEven/Autohotkey_Linux). The pages in this site are the official AutoHotkey v2 documentation, adapted for the Linux port. Only AutoHotkey v2 syntax is supported; the AutoHotkey v1 language, the v1-to-v2 migration material, and all Windows-specific behavior are not part of this port.
These pages mirror the official AutoHotkey v2 documentation, so their examples fall into three groups on Linux:
C:\... are treated as plain (oddly named) files on
Linux; use Linux paths (/tmp/..., A_Desktop,
~) in your own scripts.ComObject, ComObjGet, ...) add a Linux
example block at the top of their Examples section that uses native
.so libraries or the D-Bus bus; the original Windows
examples are kept for reference only.Gui/GuiControl/Menu,
SoundBeep/SoundPlay, TrayTip, SendMessage/
PostMessage/OnMessage, Hotstring,
...) are kept for reference; calling those functions raises a clear
error. Many examples elsewhere are also short snippets that
depend on context (a preceding variable, a hotkey label, a window with
a specific title); they illustrate syntax rather than being standalone
programs.All 367 built-in functions listed in the worklist are implemented
(3 not-implemented error paths: ComObjArray, TrayTip, TraySetIcon);
1026 doc-check assertions pass under Xvfb (including 29
for DllCall against native .so libraries and 18 for the
D-Bus COM layer). The port has two display backends:
input_backend.h), which
selects automatically:
1::/^1::/F12::
grab and suppress the physical key with no per-binding dialog). The
companion extension (extension/ in the repo) is a thin
D-Bus broker (io.github.autohotkey.GlobalHotkeys1) that
registers accelerators through
Meta.Display.grab_accelerator() +
Main.wm.allowKeybinding() (the whitelist step the portal
backend performs via shellDBus) and relays activations back; it never
parses AHK, executes commands or forks.
Verified on Ubuntu 25.10 + GNOME 49 (E2E: physical
1 fires the hotkey with no confirmation dialog, the key
is suppressed from the focused app, exiting the script restores the
key, kill -9 releases the grab fail-open, Ctrl+1/F12
and key-repeat work, and a gnome-shell extension reload
(disable/enable) is followed by automatic re-registration).
Capability scope (v1): exclusive hotkeys only — ~1::
passthrough, remaps, a & b:: and full wildcards are
NOT in this backend (evdev/ahk-inputd lane); 1 up:: has
its signal source (accelerator-deactivated is relayed) but is not yet
consumed by the runtime.AHK_INPUT_BACKEND=auto|x11|portal|gnome-shell|evdev
(auto: X11 session → X11; GNOME Wayland with the extension installed
→ gnome-shell; other Wayland → portal; evdev reports
“backend not installed” until ahk-inputd ships).
AHK_FORCE_GLOBAL_SHORTCUTS=1 keeps its documented meaning:
explicitly require the standard Portal backend (it is not reused for the
GNOME Shell backend). An XWayland/Xorg session remains the stable
fallback on all systems.ComObject("service")
(or ComObjGet) creates a proxy for a D-Bus service; method calls and
property access map to D-Bus method/property calls; ComValue wraps
typed values (integers, doubles, strings, booleans, bytes). Windows
COM interfaces (IUnknown/IDispatch pointers, SafeArrays, events) do
not exist on Linux; ComObjQuery/ComObjConnect/ComObjArray raise an
error.SoundGet*/SoundSet* mixer functions are available via
pactl (PipeWire/PulseAudio) with an ALSA amixer
fallback; SoundPlay (paplay/aplay) and SoundBeep
(terminal/X11 bell) work too. The tray icon (TrayTip) and
compiled-script packaging are not available.See CHECK_REPORT.md for the complete per-module report.
The latest official release is v2.0.26-linux.11. Highlights of this release:
~/HotIf-false/
Off hotkeys (passive grab removed + XTEST re-injection; the server
swallows a press injected while the button is held).git clone --branch linux-port https://github.com/MonoEven/Autohotkey_Linux.git cd Autohotkey_Linux cmake -S . -B build-core cmake --build build-core -j$(nproc) build-core/source/linux/core/ahk_core your-script.ahk
Prebuilt packages (tar.gz / .deb) and an installer are published with each GitHub Release: releases.
This port is based on AutoHotkey v2.0.26. The v1-to-v2 change documentation has been removed because v1 is not supported by this port.
Software License: GNU General Public License