Personal AutoHotkey fleet: global productivity hotkeys plus always-on background automation (crash recovery, Sefirah phone-link, Python servers, Linux ext4 backup SSD auto-mounting, DRM video streaming mode, Skills Vault auto-locking, and headless tablet display streaming), all orchestrated by a single compiled startup master script.
Getting the fleet running on a new machine requires a few one-time manual configurations (to protect your privacy), followed by a 1-click automated build and registration.
- Install AutoHotkey v2:
- Download the official v2 installer or run
winget install AutoHotkey.AutoHotkey. - Note: Every script in this fleet declares
#Requires AutoHotkey v2.0; the compiledStartupScript.exeruns againstAutoHotkey\v2\AutoHotkey64.exe.
- Download the official v2 installer or run
- Configure Local Paths:
- Copy
AllScripts/LocalPaths.ahk.example->AllScripts/LocalPaths.ahk. - Fill in your machine-specific paths, device IPs, and optional tool locations.
- This file is automatically gitignored to keep personal directories private.
- Copy
- Configure Personal Keywords & App Launchers:
- Copy
AllScripts/PersonalKeywords.ahk.example->AllScripts/PersonalKeywords.ahk. - Add your private hotstrings, email shortcuts, or app launchers (gitignored).
- Copy
- Enable Git Leak & Quality Protection (Recommended for Git Clones):
- Run
git config core.hooksPath .githooksin your terminal. - Activates
.githooks/pre-commit, which automatically:- Prevents committing personal usernames, computer names, or private configuration files into public git history.
- Enforces clean code comments and documentation by running
python scripts/clean_dashes.py --check(blocks em-dashes and comment double-hyphens). Auto-repair anytime usingpython scripts/clean_dashes.py --staged.
- Run
- Optional: Linux ext4 Backup SSD Engine:
- If using external ext4 backup SSDs via WSL2: Copy
AllScripts/PowerShell/ssd_config.json.example->AllScripts/PowerShell/ssd_config.json(gitignored) and customize your drive letter, disk model, and WSL distro.
- If using external ext4 backup SSDs via WSL2: Copy
Once your local paths are configured, compile and register the fleet:
- 1-Step Terminal Build:
.\build_startup_exe.ps1 -Relaunch- Automatically compiles
AllScripts\StartupScript.exeusing custom icons and the base 64-bit runtime. - Detects if
"AHK Startup Script"is missing from Windows Task Scheduler and automatically launchessetup_startup_task.ps1(prompting for Administrator approval once) to register the scheduled task. - Launches the fleet immediately via Task Scheduler in your standard user session.
- Automatically compiles
- Explorer 1-Click Batch Wrappers:
- Double-click
.\Install_Startup_Task.bat: Self-elevates and registers the scheduled task directly. - Double-click
.\Uninstall_Startup_Task.bat: Self-elevates and unregisters the scheduled task cleanly.
- Double-click
- Why Task Scheduler instead of
shell:startup?- The task is registered with a 30-second logon delay (
PT30S). - At Windows user logon, Windows Explorer, audio services, network adapters (Tailscale/Wi-Fi), and graphics drivers initialize concurrently across multiple threads.
- A 30-second delay guarantees that the desktop environment settles completely before the fleet launches, preventing startup race conditions and missing notification tray icons.
- Configured with
RunLevel Limitedunder your standard account ($env:USERNAME), eliminating boot-time UAC prompts while preserving normal window message routing.
- The task is registered with a 30-second logon delay (
Windows Task Scheduler launches the compiled binary StartupScript.exe, not the .ahk source file. A source edit to StartupScript.ahk takes effect only after recompiling:
- Recompile Command: Run
.\build_startup_exe.ps1(or click "Recompile & Relaunch" under Additional Scripts -> StartupScript in the tray menu). - Safe Recompilation: Automatically terminates the running
StartupScript.exeto release file locks, compiles a fresh binary viaAhk2Exe, and restarts the fleet seamlessly via Task Scheduler. - Child Script Edits: All managed child scripts (
BasicTasks.ahk,Brightness.ahk, etc.) require only an instant fleet reload (Win+Ctrl+Alt+Ror click "Reload All" under Additional Scripts -> StartupScript), no recompilation needed.
Protects personal skills vaults, private study roadmaps, and sensitive configuration directories during professional or organizational pair-programming sessions.
- Automated Focus Watcher (
BackgroundAutomations.ahk):- Continuously monitors active window focus:
- Focusing Claude (
claude.exe): Automatically triggerslock-personal-skills.ps1to revoke permissions and lock personal vaults (org safe mode). Displays an amber/red bottom-right badge. - Focusing Antigravity (
Antigravity.exeoragy.exe): Automatically triggersunlock-personal-skills.ps1to restore full personal workspace permissions. Displays a deep green badge.
- Focusing Claude (
- Continuously monitors active window focus:
- Manual 3-Way Mode Control (
BasicTasks.ahk):- Dedicated Tray Menu Items: Open the
BasicTaskssubmenu to view all 3 mode entries (Skills Vault: Auto (Focus-Driven),Skills Vault: Locked (Org Safe Mode),Skills Vault: Unlocked (Personal Mode)) with real-time Win32 checkmarks indicating the active state. Click any entry to switch directly. - Keyboard Cycle Hotkey: Press
Win+Alt+Lto cycle between the three modes:Auto->Force Locked->Force Unlocked. - Debounced with a 2000ms settle window for keyboard cycling (and 300ms for direct tray clicks) and protected by a Win32 named mutex (
SkillsVaultLock_AHK_v1) to prevent rapid transitions from racingicaclsACL permissions sweeps. - Color-coded bottom-right corner badge confirms status: Deep Red for
[LOCKED], Deep Green for[UNLOCKED], Deep Blue for[AUTO], and Amber forapplying....
- Dedicated Tray Menu Items: Open the
Enables desktop streaming to a tablet (such as Samsung Galaxy Tab S10 Ultra) or handheld device via Moonlight and Sunshine without physical monitor constraints. Managed by SunshineDisplayWatchdog.ahk, pinned directly at the top of StartupScript's master tray menu.
-
Display Switching Hotkeys:
- Press
Win+Alt+P: Toggles between PC Screen Only (1080p @ 144Hz, mouse speed 10, pointer precision ON) and Tablet Only (dummy plug 2560x1600 @ 120Hz, mouse speed 20, pointer precision OFF). Resets mouse speed in 0 milliseconds. - Press
Win+Alt+Shift+P: Toggles between Extend Displays (dual screen desktop, mouse speed 10) and Duplicate Displays (mirrored screen, mouse speed 20).
- Press
-
Master Tray Submenu & Dynamic Status Checkmarks:
- Pinned directly at the top level of the master AutoHotkey tray menu with zero extra standalone icons cluttering the notification area.
- Submenu provides 1-click switching between PC Screen Only, Tablet Only, Extend Displays, and Duplicate Displays with a dynamic checkmark (tick) highlighting the currently active display topology.
- Modern bottom-right rounded dark toast badge (
ShowBottomRightBadge) displays mode transitions for 5.5 seconds with auto-calculated dimensions.
-
Sunshine Extended Desktop Profile:
- Dedicated "Desktop (Extended Tab)" profile in Sunshine (
apps.json) targeting\\.\DISPLAY4. - Tablet displays the extended monitor directly while the laptop remains the primary display with all taskbar notification icons intact.
- Dedicated "Desktop (Extended Tab)" profile in Sunshine (
-
Watchdog Auto-Recovery (
SunshineDisplayWatchdog.ahk):- Fast-reacting watchdog loop checks session state every 1.5 seconds.
- Active stream synchronization: boosts mouse speed to 20 during active Moonlight streaming sessions across PC Screen Only (default mirror), Duplicate, and Tablet Only modes.
- Disconnect or pause restores normal mouse speed (10) within 1.5 seconds on PC Screen Only, Duplicate, and Extend modes.
- Active display topology guard: enforces mouse speed 10 when the stream is idle on laptop or extended displays, preventing speed-sticking glitches while keeping tablet streaming fast.
-
Hardware Lid-Open Auto-Recovery:
- Opening laptop lid triggers a Win32
WM_DISPLAYCHANGEnotification. - Automatically restores mouse speed to 10 and restores laptop display mode if
monCount <= 1. In Extend or Duplicate mode, multi-monitor configuration is preserved untouched.
- Opening laptop lid triggers a Win32
-
System Wake, Hibernate & Session Unlock Auto-Recovery:
- Catches Win32
WM_POWERBROADCAST(0x0218) system resume events. - Triple-wave recovery (500ms, 2000ms, and 4000ms) restores display topology to PC Screen Only (
DISPLAY1), restores mouse speed to 10, cycles low-level keyboard hooks to prevent dead keys after Modern Standby, and suppresses stale pre-wake Sunshine log events. - Catches Win32
WM_WTSSESSION_CHANGE(0x02B1)WTS_SESSION_UNLOCKevents: refreshes low-level keyboard hooks after unlock while preserving Tablet Only mode during remote PIN entry.
- Catches Win32
-
Simple Sticky Notes Multi-Resolution Auto-Arrangement (
apply_ssn_layout.ps1):- Automatically re-arranges Simple Sticky Notes (
ssn.exe) windows to match the active screen resolution and DPI scaling:-
Laptop (1536x864 DIP): 4 columns flush against the right bezel (
$X = 1268$ ,$W = 268 \to 1536\text{px}$ ). -
Tablet (1463x914 DIP): 4 columns shifted left to fit within the narrower 1463px canvas (
$X = 1190$ ,$W = 268 \to 1458\text{px}$ , leaving a 5px margin).
-
Laptop (1536x864 DIP): 4 columns flush against the right bezel (
- Eliminates clumping, overlapping, and off-screen window drift across manual toggles (
Win+Alt+P), Moonlight disconnects, and lid re-openings using dual-wave Win32 thread enumeration.
- Automatically re-arranges Simple Sticky Notes (
When streaming your desktop to a tablet or remote client via Moonlight/Sunshine, DRM-protected video (Netflix, Prime Video, Hotstar, Udemy) displays as a black screen due to Chromium hardware acceleration capturing protected surfaces.
- Toggle Action: Click "Graphics Accel: Brave (ON) / Chrome (OFF)" inside the
BasicTaskstray submenu. - Live Status Indication: Displays real-time hardware acceleration status for both Brave and Chrome on a single line with dynamic updates.
- How it Works:
- Detects active or frontmost Chromium browser (Brave or Google Chrome) via immediate focus, recent 20-second focus tracking across tray clicks, or desktop window Z-order. If neither browser is active, displays an informative badge and exits gracefully without disrupting background processes.
- Sends
WM_CLOSEto gracefully save open tabs and session history, then terminates lingering background processes to unlock configuration files. - Atomically edits Chromium's
Local StateJSON file to toggle"hardware_acceleration_mode": {"enabled": false}. - Relaunches the browser with
--disable-gpu --restore-last-session --disable-session-crashed-bubble. - Displays a color-coded bottom-right corner badge indicating the new status.
- Zero Display Alterations: Strictly modifies browser acceleration state; does not alter monitor resolutions, refresh rates, or virtual display topologies.
Shared toast notification surface (AllScripts/SharedHelpers.ahk) providing clean visual feedback for debounced toggles and background events.
- Singleton Surface: A second badge update modifies text and color in place without window destruction, eliminating visual flicker and transition gaps.
- DPI Scaling Immune: Operates with
-DPIScalefor 1:1 physical screen pixel accuracy across high-DPI displays. - Auto-Sizing & Aesthetics: Uses Win32 GDI
DrawTextWto dynamically size the badge according to text extent, with modern 10px rounded corners applied viaSetWindowRgn. - Color Palette:
- Deep Green (
#1A6E3C): Unlocked / active state. - Deep Red (
#8B1A1A): Locked / restricted state. - Deep Blue (
#0D4F8B): Automatic / focus-driven state. - Dark Slate Grey (
#3A3D40): Off / inactive state. - Amber (
#6E5A00): In-progress / applying changes. - Dark Orange (
#7A3B00): Error.
- Deep Green (
Global system-wide microphone mute toggle with real-time HUD feedback and an intelligent system tray indicator (AllScripts/SharedHelpers.ahk and AllScripts/BasicTasks.ahk).
- Toggle Hotkey: Press
Win+Ctrl+Alt+Mto toggle microphone mute state instantly. - Direct WASAPI Execution: Calls Windows Core Audio COM interfaces (
IMMDeviceEnumerator,IAudioEndpointVolume) directly via Win32DllCall. Executes in under 5ms with zero process-spawning overhead. - Dual Endpoint Synchronization: Simultaneously targets both
eConsole(0) andeCommunications(2) capture endpoints so Discord, Zoom, Microsoft Teams, Google Meet, and browser calls are all muted in sync. - Dynamic System Tray Indicator:
- Mute-Only Visibility: The tray icon appears in the notification area only when the microphone is muted (
mic_muted.ico). When unmuted, it hides completely for zero taskbar clutter. - Option 1 High-Contrast Icon: Features a solid pure-white (
#FFFFFF) microphone body for maximum luminance contrast on dark taskbars (#202020), crossed by a vivid neon-red (#FF2D55) diagonal slash. Pixel-perfect at 16x16 (96 DPI) up to 64x64 high-DPI scaling. - 1-Click Unmuting: Left-clicking the muted tray icon immediately unmutes the microphone and dismisses the icon.
- Mute-Only Visibility: The tray icon appears in the notification area only when the microphone is muted (
- Hardware & OS State Synchronization:
- A lightweight 1500ms background watcher (
WatchMicrophoneMuteState) keeps the tray icon synchronized if the microphone is muted or unmuted externally via hardware buttons or third-party meeting software, without triggering disruptive toast notifications.
- A lightweight 1500ms background watcher (
- Visual HUD Feedback: Displays an instant bottom-right rounded corner badge (
ShowBottomRightBadge): deep red (#8B1A1A) for "Microphone Muted" and deep green (#1A6E3C) for "Microphone Unmuted".
Watchdog.ahk watches essential background processes and automatically relaunches them if they close or crash.
- Configure watched applications in
AllScripts/LocalPaths.ahk:WATCHDOG_APPS := [{name: "SomeApp.exe", path: "C:\Path\To\SomeApp.exe"}] - Reacts to any application termination, checking every 10 seconds (
CheckIntervalMs) and restarting missing processes silently.
Plug-and-play auto-mount engine for external Linux ext4 SSDs on Windows 11 using WSL2, Samba, and AutoHotkey (AllScripts/Ext4SsdManager.ahk).
- Automations:
- USB Hotplug:
WM_DEVICECHANGE(0x0007/0x8000) detects hardware arrival via in-memory WMI check (22ms), attaches block device via zero-UAC scheduled task, starts guest keepalive, mounts ext4 (noatime,nodiratime,errors=remount-ro), probes Samba TCP port 445, maps drive letter (defaultP:), and opens the configured target folder in Explorer. - USB Unplug:
WM_DEVICECHANGE(0x8004/ hardware drop) gracefully redirects open Explorer tabs viewing the drive to "This PC" (preventing broken window errors), unmaps the drive letter, lazy-unmounts guest ext4, and cleans Hyper-V attachments. - Boot / Wake: Auto-reconciles state on boot and system wake (
WM_POWERBROADCAST). - Manual Hotkeys & Tray Controls:
Win+Alt+M: Manual mount and open in Explorer.Win+Alt+U: Safe ejection (sets flag so watchdog will not prematurely remount while plugged in).- Tray Menu: Click AutoHotkey tray icon -> "Additional Scripts" -> "Ext4SsdManager" -> "Mount Pixel SSD (P:)" / "Eject Pixel SSD Safely" / "Register Zero-UAC Tasks".
- USB Hotplug:
- Setup & Guide:
- Double-click
AllScripts\PowerShell\Install_WSL_Mount_Tasks.batto register zero-UAC scheduled tasks. - See AllScripts/PowerShell/README.md for full Samba configuration steps and architecture details.
- Double-click
Direct, zero-friction file transfer from Windows Explorer to connected Samsung devices (/sdcard/Download/_LaptopTransfers/) via Dual-IP ADB (SendToDevice_Adb.ps1).
- Hotkeys:
- Single tap
Win+Alt+T: Pushes selected Explorer file(s) to Samsung Galaxy S24 Ultra. - Double tap
Win+Alt+T+T(within 500ms): Pushes selected Explorer file(s) to Samsung Galaxy Tab S10 Ultra.
- Single tap
- Failover & Safety:
- Dual-IP Failover: Probes Tailscale IP first; if offline, immediately fails over to Local Wi-Fi LAN IP (or dynamically from
sefirah.db). - 500ms Socket Pre-Check: Eliminates the native 21-second ADB connect timeout on unreachable networks.
- Duplicate Auto-Numbering: Prevents overwriting files in destination (
notes (1).txt,notes (2).txt) using O(1) in-memory HashSets. - URI-Encoded MediaScanner: Triggers Android media indexation with properly escaped URIs so transferred files appear immediately in Samsung Gallery and My Files.
- Interactive Sefirah Fallback: Automatically launches Sefirah GUI if wireless debugging is offline on Android.
- Dual-IP Failover: Probes Tailscale IP first; if offline, immediately fails over to Local Wi-Fi LAN IP (or dynamically from
StartupScript.ahk consolidates the entire fleet into a clean, single system tray icon:
- Left-Click & Right-Click: Both left-click and right-click on the tray icon open the master tray context menu. Nothing else.
- Pinned Scripts: Pinned scripts (
SunshineDisplayWatchdog,BasicTasks,PersonalKeywords) sit at the top level of the menu for instant access. - Additional Scripts Submenu: All remaining background scripts (
BackgroundAutomations,Brightness,ClosePrograms,Ext4SsdManager,HotkeyHelp,LocalPaths,SharedHelpers,Watchdog) are collapsed into an expandable "Additional Scripts" submenu to prevent vertical clutter. - Submenu Separator Lines: Child script submenus cleanly separate standard controls (
View Key History,Edit,Restart,Exit) from custom published actions using native horizontal separator bars (-|). - Global Fleet Actions: Positioned at the bottom: "Suspend Hotkeys" (global cascade toggle) and "Exit". Fleet maintenance controls ("Reload All" and "Recompile & Relaunch") live inside "Additional Scripts -> StartupScript" to prevent top-level menu clutter.
-
Key Usage F1Set Current +5 Brightness Shift+F1Set Current -5 Brightness Ctrl+PgDnPush Brightness Extremes Down -10 Ctrl+PgUpPush Brightness Extremes Up +10 -
Key Usage WheelUp/WheelDown(Over Taskbar) System Volume Up / Down when mouse is scrolled anywhere over the Windows Taskbar Volume_UpVolume Up (+10) Volume_DownVolume Down (-10) Win+DelEmpty Recycle Bin Win+CRun Calculator Win+MMinimize Active Window Win+FOpen Firefox Win+X+XSleep Laptop (double-tap Win+X puts laptop to sleep; single Win+X opens normal Quick Link menu) Win+Shift+AOpen Notification Center / Action Center Win+Shift+EOpen Screenshots Folder ( %UserProfile%\Pictures\Screenshots)Win+Shift+JOpen Java Course Folder ( %PATH_JAVA_COURSE%)Win+Alt+CRun Windows Alarm Clock ( Microsoft.WindowsAlarms)Win+Alt+Ctrl+COpen PowerShell 7 as Administrator Win+Alt+NClear All Notifications in Windows 11 Action Center Win+Alt+XReconnect Cloudflare WARP / Run IP Rotator ( %PATH_IP_ROTATOR%)Win+Alt+LCycle Skills Vault Mode (Auto -> Force Locked -> Force Unlocked) Win+Ctrl+Alt+MToggle Microphone Mute state across all endpoints with HUD badge and dynamic tray indicator Win+Alt+TWirelessly send selected file(s) to S24 Ultra (Double-tap within 500ms sends to Tab S10 Ultra) Alt+Ctrl+ZCapture selection and open in ShareX Image Editor Ctrl+C(In OneNote) Intercepts OneNote copy to extract clean text instead of pasting as an image/screenshot Alt+F11Toggle Window Caption Bar / Titlebar on active window (borderless fullscreen) Alt+XOpen Today's Calendar in browser (Checker Plus extension / Google Calendar) Alt+DOpen ChatGPT in browser Alt+GMonica AI Grammar Correction (copies selected text and launches Monica grammar fix) Alt+Shift+SMonica AI Summarize Content (copies selected text and launches Monica summary) Alt+Ctrl+DSort Explorer Folder Content by Date Alt+Ctrl+EToggle File Extension Visibility in Explorer Alt+Ctrl+HToggle Hidden Files Visibility in Explorer Alt+Ctrl+MouseLButtonMove background windows without activating or bringing them to foreground Ctrl+GGoogle Search selected/clipboard text in browser Ctrl+T+TOpen new browser tab from anywhere (double-tap Ctrl+T) Ctrl+J+JClose bottom downloads shelf in Chrome/Brave (double-tap Ctrl+J) Ctrl+Y+TOpen YouTube in browser Ctrl+Shift+VReturn to previous browser tab when capturing screenshot in Awesome Screen Recorder Ctrl+Shift+WheelUp(In VS Code) Increase Whole UI Zoom (+0.05 zoomLevel) Ctrl+Shift+WheelDown(In VS Code) Decrease Whole UI Zoom (-0.05 zoomLevel) Capslock+CapslockDouble-tap CapsLock to toggle CapsLock on/off (prevents accidental toggling) -
Key Usage Win+Alt+PToggle PC Screen Only (1080p @ 144Hz, mouse speed 10) <-> Tablet Only (2560x1600 @ 120Hz, mouse speed 20) Win+Alt+Shift+PToggle Extend Displays (Dual screens, mouse speed 10) <-> Duplicate Displays (Mirrored, mouse speed 20) -
Key Usage Win+Alt+MMount ext4 Backup SSD & Open in Explorer Win+Alt+USafely Unmount ext4 Backup SSD -
Key Usage Win+F1Display Interactive Hotkey Help GUI Ctrl+FFind in Hotkey Help Win+Ctrl+F1Excluded Files, Hotkeys, and Hotstrings Win+Alt+Ctrl+F1Raw Hotkey List Win+Alt+F1Settings -
Key / Action Usage Tray Left-Click / Right-ClickOpen Master Tray Context Menu Tray Hover TooltipDisplays dynamic sorted list of all currently active scripts Win+ScrollLockSuspend All Scripts' Hotkeys (background timers and watchers keep running) Win+Ctrl+Alt+ScrollLockTerminate All Scripts (clean fleet exit) Win+Ctrl+Alt+RReload All Scripts (instant fleet-wide reload) Win+Ctrl+Alt+WRun Window Spy utility -
-
It's a key-value pair. Type the key in the text field to get its corresponding value.
Keyword / Key Usage ValueOfPie3.141592653589793238e1.demo@example.com(Email 1)e2.demo2@example.com(Email 2)c1.+1-555-0100(Contact 1)thnk.Universal autonomous 5-phase engineering reasoning prompt Win+Alt+AOpen Samsung Notes / Notes App Win+Alt+SOpen Notion Win+Shift+POpen Bitwarden Vault
-
-
-
For programs that go to the system tray when closed by pressing the close button
Key Usage Alt+Ctrl+F4Close All Programs (gracefully closes open desktop applications) Alt+Shift+F4Close Specific Active Program (terminates stubborn background tray apps) Alt+F4Close Currently Active Screen (with key-release guard and tray cleanup)
-
- Get installed app names and AppIDs:
Get-StartApps | Sort-Object Name | Format-Table -Property Name, AppID
- Run an app from AutoHotkey via its AppID:
Run("shell:AppsFolder\SamsungNotes_8wekyb3d8bbwe!App")
💡 Fleet Maintenance Tip: After editing any child script (e.g. BasicTasks.ahk), press Win+Ctrl+Alt+R (or select "Reload All" in the tray menu) to reload the fleet instantly. Recompilation via build_startup_exe.ps1 is only required when modifying StartupScript.ahk.