https://github.com/jamesmessinger/autohotkey
My custom AutoHotKey scripts
https://github.com/jamesmessinger/autohotkey
autohotkey autohotkey-script keyboard-shortcuts window-management window-manager
Last synced: 14 days ago
JSON representation
My custom AutoHotKey scripts
- Host: GitHub
- URL: https://github.com/jamesmessinger/autohotkey
- Owner: JamesMessinger
- License: mit
- Created: 2018-03-05T00:00:23.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-07-15T16:52:18.000Z (almost 4 years ago)
- Last Synced: 2025-02-02T00:13:07.937Z (5 months ago)
- Topics: autohotkey, autohotkey-script, keyboard-shortcuts, window-management, window-manager
- Language: AutoHotkey
- Size: 85 KB
- Stars: 12
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
My Custom AutoHotKey Scripts
------------------------------------
These 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.### [`remap-keys.ahk`](src/remap-keys.ahk)
This script simply re-maps a few keyboard keys to behave the way I prefer.### [`restore-window-layout.ahk`](src/restore-window-layout.ahk)
This 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.Hotkey | Behavior
:------|:-------------------
Alt+Win+0 | Save the current window layout for the current monitor configuration.
Depending 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.
Ctrl+Win+0 | Restore the layout of the **active window** for the current monitor configuration.
Ctrl+Shift+Win+0 | Restore the layout of **all windows** for the current monitor configuration.
The 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.### [`advanced-window-snap.ahk`](src/advanced-window-snap.ahk)
This 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.##### Default Windows Hotkeys
Hotkey | Behavior
:------|:-------------------
Win+← | Snap to the left **half** of the screen
Win+→ | Snap to the right **half** of the screen
Win+↑ | Maximize the window
Win+↓ | Restore/minimize the window##### Advanced Hotkeys (horizontal)
Hotkey | Behavior
:------|:-------------------
Alt+Win+← | Snap to the left **third** of the screen
Alt+Win+→ | Snap to the right **third** of the screen
Alt+Win+↓ | Snap to the middle **third** of the screen
Alt+Win+↑ | Snap to the middle **half** of the screen
Shift+Win+← | Snap to the left **two-thirds** of the screen
Shift+Win+→ | Snap to the right **two-thirds** of the screen
Shift+Win+↓ | Snap to the middle **two-thirds** of the screen
Shift+Win+↑ | Snap to the middle **two-thirds** of the screen##### Advanced Hotkeys (vertical)
Hotkey | Behavior
:------|:-------------------
Ctrl+Win+↑ | Snap to the top **half** of the screen
Ctrl+Win+↓ | Snap to the bottom **half** of the screen
Ctrl+Win+← | Snap to the middle **half** of the screen
Ctrl+Win+→ | Snap to the middle **half** of the screen
Ctrl+Alt+Win+↑ | Snap to the top **third** of the screen
Ctrl+Alt+Win+↓ | Snap to the bottom **third** of the screen
Ctrl+Alt+Win+← | Snap to the middle **third** of the screen
Ctrl+Alt+Win+→ | Snap to the middle **third** of the screen
Ctrl+Shift+Win+↑ | Snap to the top **two-thirds** of the screen
Ctrl+Shift+Win+↓ | Snap to the bottom **two-thirds** of the screen
Ctrl+Shift+Win+← | Snap to the middle **two-thirds** of the screen
Ctrl+Shift+Win+→ | Snap to the middle **two-thirds** of the screen##### Advanced Hotkeys (centering)
Hotkey | Behavior
:------|:-------------------
Win+Enter | Center the window on screen (big)
Alt+Win+Enter | Center the window on screen (small)##### Advanced Hotkeys (using the number pad)
Hotkey | Behavior
:------|:-------------------
Win+Numpad 7 | Snap to the top-left **half** of the screen
Win+Numpad 8 | Snap to the top **half** of the screen
Win+Numpad 9 | Snap to the top-right **half** of the screen
Win+Numpad 4 | Snap to the left **half** of the screen
Win+Numpad 5 | Snap to the middle **half** of the screen
Win+Numpad 6 | Snap to the right **half** of the screen
Win+Numpad 1 | Snap to the bottom-left **half** of the screen
Win+Numpad 2 | Snap to the bottom **half** of the screen
Win+Numpad 3 | Snap to the bottom-right **half** of the screen
Alt+Win+Numpad 7 | Snap to the top-left **third** of the screen
Alt+Win+Numpad 8 | Snap to the top **third** of the screen
Alt+Win+Numpad 9 | Snap to the top-right **third** of the screen
Alt+Win+Numpad 4 | Snap to the left **third** of the screen
Alt+Win+Numpad 5 | Snap to the middle **third** of the screen
Alt+Win+Numpad 6 | Snap to the right **third** of the screen
Alt+Win+Numpad 1 | Snap to the bottom-left **third** of the screen
Alt+Win+Numpad 2 | Snap to the bottom **third** of the screen
Alt+Win+Numpad 3 | Snap to the bottom-right **third** of the screen
Shift+Win+Numpad 7 | Snap to the top-left **two-thirds** of the screen
Shift+Win+Numpad 8 | Snap to the top **two-thirds** of the screen
Shift+Win+Numpad 9 | Snap to the top-right **two-thirds** of the screen
Shift+Win+Numpad 4 | Snap to the left **two-thirds** of the screen
Shift+Win+Numpad 5 | Snap to the middle **two-thirds** of the screen
Shift+Win+Numpad 6 | Snap to the right **two-thirds** of the screen
Shift+Win+Numpad 1 | Snap to the bottom-left **two-thirds** of the screen
Shift+Win+Numpad 2 | Snap to the bottom **two-thirds** of the screen
Shift+Win+Numpad 3 | Snap to the bottom-right **two-thirds** of the screenInstallation and Usage
------------------------------------
To get these scripts working on your computer, follow these steps:1. __Install AutoHotKey__
You can [download it here](https://www.autohotkey.com/download/)2. __Clone this repo__
`git clone https://github.com/JamesMessinger/AutoHotKey.git`3. __Create an `AutoHotKey.ahk` file__
When 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.```AutoHotKey
AutoHotKeyDir := "C:\Users\James Messinger\Code\AutoHotKey" ; <--- Edit this to point to your path
Run, %A_AhkPath% "%AutoHotKeyDir%\src\AutoHotKey.ahk", %AutoHotKeyDir%
```4. __Set AutoHotKey to run at startup__
Create a shortcut to AutoHotKey (`C:\Program Files\AutoHotkey\AutoHotkey.exe`). Then open the Windows Run utility (Win+R) and type `shell:startup` to open your Startup folder. Then paste the AutoHotKey shortcut in this folder.License
------------------------------------
All 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!