- Install AutoHotKey (v2 Dual-Runtime Recommended):
- Install AutoHotkey v2 via Official Installer or PowerShell:
winget install AutoHotkey.AutoHotkey
- The AHK v2 installer automatically sets up the AutoHotkey Launcher, which seamlessly runs both v1 and v2 scripts side-by-side based on the
#Requiresdirective at the top of each script.
- Install AutoHotkey v2 via Official Installer or PowerShell:
- Version Directives (
#Requires):- Legacy scripts in
AllScripts/use#Requires AutoHotkey v1.1to ensure the launcher uses the v1 interpreter without breaking functionality. - Any new scripts can use
#Requires AutoHotkey v2.0to take advantage of modern v2 features.
- Legacy scripts in
- Add the scripts directory to
StartupScript.ahkto run all scripts at once. - Local Custom Paths: Copy
local_paths.ahk.exampletolocal_paths.ahkin the root directory to define your machine-specific paths (e.g. custom courses or scripts).local_paths.ahkis automatically ignored by Git to keep your folder structure private. - Personal Keywords & Privacy: Copy
AllScripts/PersonalKeywords.ahk.exampletoAllScripts/PersonalKeywords.ahkto define your private hotstrings, passwords, and shortcuts.PersonalKeywords.ahkis automatically ignored by Git to prevent accidental data leaks. - Compiled Executables:
.exefiles are not tracked in Git. CompileStartupScript.ahklocally using Ahk2Exe whenever needed (see section below).
Note: Task Scheduler's "AHK Startup Script" task launches the compiled StartupScript.exe,
not the .ahk source directly — a source edit alone does not take effect until the exe is
rebuilt using one of the methods below.
.\build_startup_exe.ps1Rebuilds StartupScript.exe with the correct icon and base binary in one step, and
auto-stops any already-running StartupScript.exe first (it locks itself while running,
which otherwise makes the compiler fail with "is still running, and needs to be
unloaded"). Doesn't relaunch it after building — prints the command to do that when ready.
- Right-click any
.ahkscript (e.g.StartupScript.ahk) in File Explorer and select Compile Script (GUI) (or launchC:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe). - Source: Select your
.ahkscript file. - Destination: Select the output
.exefilename (e.g.StartupScript.exe). - Custom Icon (.ico): Click Browse and select your
.icofile (e.g.StartupScript.ico). - Base Bin: Select the installed
AutoHotkeyU64.exe(v1) — not a.binfile on this setup. - Compression (Optional): Set the UPX path to
upx-3.95-win64\upx.exefor executable compression. - Click Convert. Stop any already-running
StartupScript.exefirst (Task Manager), same reason as Method 1.
Run the following command in PowerShell / CMD to compile with a custom icon:
& "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.exe" /in "AllScripts\StartupScript.ahk" /out "AllScripts\StartupScript.exe" /icon "StartupScript.ico" /base "C:\Program Files\AutoHotkey\AutoHotkeyU64.exe" /silent verbose/silent verbose is required when running non-interactively (e.g. from a script) — without it, Ahk2Exe opens its GUI compiler window instead of compiling directly and does nothing.
AllScripts\Watchdog.ahk (one of the scripts StartupScript.ahk launches at boot) polls
a configurable list of apps and relaunches any that aren't running. Fully generic — it has
no knowledge of which apps it watches; that lives entirely in local_paths.ahk, so real
paths never end up in a tracked file.
To watch an app, add one entry to WATCHDOG_APPS in local_paths.ahk (see
local_paths.ahk.example for the placeholder form):
WATCHDOG_APPS := [{name: "SomeApp.exe", path: "C:\Path\To\SomeApp.exe"}]Multiple entries are just more array items. Nothing else needs to change — Watchdog.ahk
itself never needs editing to add or remove a watched app.
Reacts to any exit (crash or deliberate close) — there's no reliable way from outside
the process to tell the two apart, so closing a watched app normally will bring it back
within one poll interval (CheckIntervalMs in Watchdog.ahk, 10s by default). This
replaced an earlier attempt using Task Scheduler's RestartOnFailure setting, which was
measured to correctly detect a crash's failure exit code but never actually queue a
restart — unreliable in practice, not just here.
-
Key Usage F1 Set Current +5 Brightness Shift+F1 Set Current -5 Brightness Ctrl+PgDn Push Brightness Extremes Down -10 Ctrl+PgUp Push Brightness Extremes Up +10 -
Key Usage Win+Del Empty Recycle Bin Win+C Run Calculator Win+M Minimize Active Window Win+F Open FireFox Win+F8 Bluetooth On/Off Win+Shift+A Open Notification Center Win+Shift+E (Folder) Open Downloads (Screenshots) Folder Win+Shift+J (Folder) Open Java Course Win+Alt+C Run Alarm Clock Win+Alt+N Clear Notification Center Win+Alt+X (Script) Reconnect Cloudflare Network Alt+X Open Today Calendar in Checker Plus Extension Alt+D Open ChatGPT Alt+G Monica AI Grammar Correction Alt+Shift+S Monica AI Content Summary Alt+Shift+T This Window Always on Top Alt+Ctrl+D Sort Folder Content by Date Alt+Ctrl+E Enable/Disable File Extension Alt+Ctrl+H Enable/Disable Hidden Files Alt+Ctrl+MouseLButton Move Background Apps Ctrl+G Search the Selected/Clipboard Text Ctrl+T+T Open New Tab (In Browser) Ctrl+J+J Close Downloads Bar (In Browser) Ctrl+Y+T Open YouTube (In Browser) Ctrl+Shift+V Browser to Go to Previous Tab When Taking a Screenshot in Awesome Screen Recorder Capslock+Capslock Double Tap to Activate/Deactivate MouseLButton Double Click Functions (Taskbar Show/Hide) -
Key Usage Win+F1 Display Help Ctrl+F Find in Hotkey Help Win+Ctrl+F1 Excluded Files, Hotkeys, and Hotstrings Win+Alt+Ctrl+F1 Raw Hotkey List Win+Alt+F1 Settings -
Key Usage Win+ScrollLock Suspend All Scripts Win+Ctrl+Alt+ScrollLock Terminate All Scripts Win+Ctrl+Alt+R Reload All Scripts Win+Ctrl+Alt+W Run Window Spy Script -
-
It's a key-value pair. Type the key in the text field to get its corresponding value.
Key Usage ValueOfPie 3.141592653589793238
-
-
-
For programs that go to the system tray when closed by pressing the close button
Key Usage Alt+Ctrl+F4 Close All Programs Alt+F4 Close Currently Active Screen
-
- Get Installed Apps names (Powershell):
Get-StartApps | Sort-Object Name | Format-Table -Property Name, AppID
- Open the app in AHK:
Run, shell:AppsFolder\SamsungNotes_8wekyb3d8bbwe!App