A simple AutoHotkey script for quickly launching or switching to your applications using keyboard shortcuts.
I wanted Vim-style chorded keys to jump between the apps I use all day. Windows doesn't really have a good answer for that, and alt tab is for normies <3
- Windows operating system
- AutoHotkey v2.0+
- Install AutoHotkey v2
- Download the script
- Clone the repo:
git clone https://github.com/kylegl/app-hot-key.git- Or download appHotKey.ahk directly
- Double-click the script to run it
Press Win + R, type shell:startup, and press Enter
Then either:
- Copy the
.ahkfile into the Startup folder - Or create a shortcut to the
.ahkfile and move it there
The script will now launch automatically when you sign in
Press <leader> followed by a key to launch or focus an application
Examples:
<leader>+ 1 → Chrome<leader>+ 2 → VS Code<leader>+ 3 → Discord<leader>+ 4 → Spotify<leader>+ 5 → Terminal
How it works:
- If the app is already running, it brings it to the foreground
- If the app is not running, it launches it
Default Configuration
LEADER_KEY := "!Space" ; Change this to remap the hotkey trigger
DEBUG_MODE := false ; Set to true to enable debug logging
INPUT_TIMEOUT := 1 ; How long (seconds) to wait for key press
LOG_FILE_NAME := "debug.log" ; Debug log filenameChange the leader key
- Modify
LEADER_KEYat the top of the script - Example: Change
"!Space"to"^Space"for Ctrl+Space
Add or change apps
- Edit the
AppsMap in the script - Each entry uses the format:
"key", {Name: "...", Path: "...", Window: "...", TitlePattern: "..."} - Properties:
- Name (required): Display name
- Path (required): Command to execute (can include arguments)
- Window (required): AHK window identifier (typically
ahk_exe process.exe) - TitlePattern (optional): Regex for matching window titles
Example:
"1", {Name: "Chrome", Path: "chrome.exe", Window: "ahk_exe chrome.exe", TitlePattern: ".* - Google Chrome$"}
"2", {Name: "Discord", Path: 'cmd.exe /c "%LOCALAPPDATA%\Discord\Update.exe --processStart Discord.exe"', Window: "ahk_exe Discord.exe"}Change slot keys
- Change the
Appsmap keys - Example: Change
"1"to"a"to use the letter 'a' as a slot key
Enable debug mode
- Set
DEBUG_MODEtotrueat the top of the script - Debug logs are written to
debug.login the script's directory - Check the log file for troubleshooting information
MIT License © Kyle Lauber