{"id":15368235,"url":"https://github.com/jamesmessinger/autohotkey","last_synced_at":"2026-02-02T04:34:27.278Z","repository":{"id":85899488,"uuid":"123841057","full_name":"JamesMessinger/AutoHotKey","owner":"JamesMessinger","description":"My custom AutoHotKey scripts","archived":false,"fork":false,"pushed_at":"2021-07-15T16:52:18.000Z","size":87,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T00:13:07.937Z","etag":null,"topics":["autohotkey","autohotkey-script","keyboard-shortcuts","window-management","window-manager"],"latest_commit_sha":null,"homepage":null,"language":"AutoHotkey","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JamesMessinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-05T00:00:23.000Z","updated_at":"2024-10-01T07:46:55.000Z","dependencies_parsed_at":"2023-03-04T11:45:44.991Z","dependency_job_id":null,"html_url":"https://github.com/JamesMessinger/AutoHotKey","commit_stats":{"total_commits":94,"total_committers":1,"mean_commits":94.0,"dds":0.0,"last_synced_commit":"fc240712ba6ac832cb32c8feb7b096385d6c3128"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMessinger%2FAutoHotKey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMessinger%2FAutoHotKey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMessinger%2FAutoHotKey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JamesMessinger%2FAutoHotKey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JamesMessinger","download_url":"https://codeload.github.com/JamesMessinger/AutoHotKey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245931272,"owners_count":20695953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autohotkey","autohotkey-script","keyboard-shortcuts","window-management","window-manager"],"created_at":"2024-10-01T13:28:47.354Z","updated_at":"2026-02-02T04:34:22.259Z","avatar_url":"https://github.com/JamesMessinger.png","language":"AutoHotkey","funding_links":[],"categories":[],"sub_categories":[],"readme":"My Custom AutoHotKey Scripts\r\n------------------------------------\r\nThese are my customized scripts for [AutoHotKey](https://www.autohotkey.com/).  These are highly tailored to my specific needs and preferences, but feel free to use them as a starting point for your own scripts.\r\n\r\n\r\n### [`remap-keys.ahk`](src/remap-keys.ahk)\r\nThis script simply re-maps a few keyboard keys to behave the way I prefer.\r\n\r\n\r\n### [`restore-window-layout.ahk`](src/restore-window-layout.ahk)\r\nThis script allows you to save and restore window layouts for different monitor setups.  This is useful when undocking/re-docking a laptop to a docking station, or when connecting/disconnecting external monitors, projectors, etc.\r\n\r\nHotkey | Behavior\r\n:------|:-------------------\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e0\u003c/kbd\u003e | Save the current window layout for the current monitor configuration.\u003cbr\u003e\u003cbr\u003eDepending on how many monitors are connected, the window layout will be saved in the `config` directory as `1-monitor-layout.txt`, `2-monitor-layout.txt`, etc.\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e0\u003c/kbd\u003e | Restore the layout of the **active window** for the current monitor configuration.\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e0\u003c/kbd\u003e | Restore the layout of **all windows** for the current monitor configuration.\u003cbr\u003e\u003cbr\u003eThe window layout file is deleted afterward. You can create a `config\\#-monitor-layout.default.txt` file for each monitor configuration, which will be applied if there is no saved layout file.\r\n\r\n\r\n### [`advanced-window-snap.ahk`](src/advanced-window-snap.ahk)\r\nThis script is based on [this script by Andrew Moore](https://gist.github.com/AWMooreCO/1ef708055a11862ca9dc), which extends Windows 10's built-in [window-snapping hotkeys](https://www.cnet.com/how-to/all-the-windows-10-keyboard-shortcuts-you-need-to-know/) to support additional window sizes and positions.\r\n\r\n##### Default Windows Hotkeys\r\nHotkey | Behavior\r\n:------|:-------------------\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026larr;\u003c/kbd\u003e | Snap to the left **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026rarr;\u003c/kbd\u003e | Snap to the right **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026uarr;\u003c/kbd\u003e | Maximize the window\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026darr;\u003c/kbd\u003e | Restore/minimize the window\r\n\r\n##### Advanced Hotkeys (horizontal)\r\nHotkey | Behavior\r\n:------|:-------------------\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026larr;\u003c/kbd\u003e | Snap to the left **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026rarr;\u003c/kbd\u003e | Snap to the right **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026darr;\u003c/kbd\u003e | Snap to the middle **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026uarr;\u003c/kbd\u003e | Snap to the middle **half** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026larr;\u003c/kbd\u003e | Snap to the left **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026rarr;\u003c/kbd\u003e | Snap to the right **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026darr;\u003c/kbd\u003e | Snap to the middle **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026uarr;\u003c/kbd\u003e | Snap to the middle **two-thirds** of the screen\r\n\r\n##### Advanced Hotkeys (vertical)\r\nHotkey | Behavior\r\n:------|:-------------------\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026uarr;\u003c/kbd\u003e | Snap to the top **half** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026darr;\u003c/kbd\u003e | Snap to the bottom **half** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026larr;\u003c/kbd\u003e | Snap to the middle **half** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026rarr;\u003c/kbd\u003e | Snap to the middle **half** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026uarr;\u003c/kbd\u003e | Snap to the top **third** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026darr;\u003c/kbd\u003e | Snap to the bottom **third** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026larr;\u003c/kbd\u003e | Snap to the middle **third** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026rarr;\u003c/kbd\u003e | Snap to the middle **third** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026uarr;\u003c/kbd\u003e | Snap to the top **two-thirds** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026darr;\u003c/kbd\u003e | Snap to the bottom **two-thirds** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026larr;\u003c/kbd\u003e | Snap to the middle **two-thirds** of the screen\r\n\u003ckbd\u003eCtrl\u003c/kbd\u003e+\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003e\u0026rarr;\u003c/kbd\u003e | Snap to the middle **two-thirds** of the screen\r\n\r\n##### Advanced Hotkeys (centering)\r\nHotkey | Behavior\r\n:------|:-------------------\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eEnter\u003c/kbd\u003e | Center the window on screen (big)\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eEnter\u003c/kbd\u003e | Center the window on screen (small)\r\n\r\n##### Advanced Hotkeys (using the number pad)\r\nHotkey | Behavior\r\n:------|:-------------------\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 7\u003c/kbd\u003e | Snap to the top-left **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 8\u003c/kbd\u003e | Snap to the top **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 9\u003c/kbd\u003e | Snap to the top-right **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 4\u003c/kbd\u003e | Snap to the left **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 5\u003c/kbd\u003e | Snap to the middle **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 6\u003c/kbd\u003e | Snap to the right **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 1\u003c/kbd\u003e | Snap to the bottom-left **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 2\u003c/kbd\u003e | Snap to the bottom **half** of the screen\r\n\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 3\u003c/kbd\u003e | Snap to the bottom-right **half** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 7\u003c/kbd\u003e | Snap to the top-left **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 8\u003c/kbd\u003e | Snap to the top **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 9\u003c/kbd\u003e | Snap to the top-right **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 4\u003c/kbd\u003e | Snap to the left **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 5\u003c/kbd\u003e | Snap to the middle **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 6\u003c/kbd\u003e | Snap to the right **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 1\u003c/kbd\u003e | Snap to the bottom-left **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 2\u003c/kbd\u003e | Snap to the bottom **third** of the screen\r\n\u003ckbd\u003eAlt\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 3\u003c/kbd\u003e | Snap to the bottom-right **third** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 7\u003c/kbd\u003e | Snap to the top-left **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 8\u003c/kbd\u003e | Snap to the top **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 9\u003c/kbd\u003e | Snap to the top-right **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 4\u003c/kbd\u003e | Snap to the left **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 5\u003c/kbd\u003e | Snap to the middle **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 6\u003c/kbd\u003e | Snap to the right **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 1\u003c/kbd\u003e | Snap to the bottom-left **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 2\u003c/kbd\u003e | Snap to the bottom **two-thirds** of the screen\r\n\u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eNumpad 3\u003c/kbd\u003e | Snap to the bottom-right **two-thirds** of the screen\r\n\r\n\r\n\r\nInstallation and Usage\r\n------------------------------------\r\nTo get these scripts working on your computer, follow these steps:\r\n\r\n1. __Install AutoHotKey__\u003cbr\u003e\r\nYou can [download it here](https://www.autohotkey.com/download/)\r\n\r\n2. __Clone this repo__\u003cbr\u003e\r\n`git clone https://github.com/JamesMessinger/AutoHotKey.git`\r\n\r\n3. __Create an `AutoHotKey.ahk` file__\u003cbr\u003e\r\nWhen AutoHotKey starts up, it looks for a file named `AutoHotKey.ahk` in your Documents folder.  So create a file by that name, and point it to where you cloned this repo in Step 2.\r\n\r\n```AutoHotKey\r\nAutoHotKeyDir := \"C:\\Users\\James Messinger\\Code\\AutoHotKey\"         ; \u003c--- Edit this to point to your path\r\nRun, %A_AhkPath% \"%AutoHotKeyDir%\\src\\AutoHotKey.ahk\", %AutoHotKeyDir%\r\n```\r\n\r\n4. __Set AutoHotKey to run at startup__\u003cbr\u003e\r\nCreate a shortcut to AutoHotKey (`C:\\Program Files\\AutoHotkey\\AutoHotkey.exe`).  Then open the Windows Run utility (\u003ckbd\u003eWin\u003c/kbd\u003e+\u003ckbd\u003eR\u003c/kbd\u003e) and type `shell:startup` to open your Startup folder.  Then paste the AutoHotKey shortcut in this folder.\r\n\r\n\r\n\r\nLicense\r\n------------------------------------\r\nAll of these scripts are [MIT licensed](http://opensource.org/licenses/MIT) and can be used however you want.  [AutoHotKey](https://www.autohotkey.com/) is [open-source](https://github.com/Lexikos/AutoHotkey_L) too!\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmessinger%2Fautohotkey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesmessinger%2Fautohotkey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmessinger%2Fautohotkey/lists"}