https://github.com/wang-q/mrw
Mr. W - Move and resize windows on macOS/Windows
https://github.com/wang-q/mrw
autohotkey cross-platform hammerspoon keyboard-shortcuts macos productivity-tools window-control window-manager windows
Last synced: 2 months ago
JSON representation
Mr. W - Move and resize windows on macOS/Windows
- Host: GitHub
- URL: https://github.com/wang-q/mrw
- Owner: wang-q
- License: mit
- Created: 2023-12-16T19:09:37.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-18T21:01:26.000Z (over 1 year ago)
- Last Synced: 2025-02-18T21:39:17.807Z (over 1 year ago)
- Topics: autohotkey, cross-platform, hammerspoon, keyboard-shortcuts, macos, productivity-tools, window-control, window-manager, windows
- Language: Lua
- Homepage:
- Size: 37.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mr. W - Move and resize windows on macOS/Windows
- [Mr. W - Move and resize windows on macOS/Windows](#mr-w---move-and-resize-windows-on-macoswindows)
- [Usage](#usage)
- [Moving](#moving)
- [Resizing](#resizing)
- [Testing](#testing)
- [macOS - Hammerspoon](#macos---hammerspoon)
- [Windows - AutoHotkey v2](#windows---autohotkey-v2)
- [Ideas](#ideas)
## Usage
| Symbol | Key |
| :-------------------: | :-------------------------------------------: |
| hyper | ctrl+opt+cmd |
| | ctrl+win+alt |
| hyperShift | hyper+shift |
> Note: Hotkey combinations differ slightly between macOS and Windows, but functionality remains consistent.
> Fun fact: Project named after the famous [Mitosis Rap: Mr. W's Cell Division Song](https://www.youtube.com/watch?v=pOsAbTi9tHw) 🧫 🔬 🧬
### Moving
* Center current window. hyper+C/Del/Forward Delete
* Move to edges
* Left - hyper+Home
* Right - hyper+End
* Top - hyper+PgUp
* Bottom - hyper+PgDn
* Move current window to another monitor. hyper+J/K
### Resizing
* Fixed ratio window
* Native ratio window (first maximize, then loop through ratios: 0.9, 0.7, 0.5). hyperShift+M/Enter/Return
* 4:3 ratio window (loop through ratios: 1.0, 0.9, 0.7, 0.5). hyper+M/Enter/Return
* Width adjustments
* Loop through screen width ratios: 3/4, 3/5, 1/2, 2/5, 1/4. hyper+Left/Right
* Set to vertical half screen. hyperShift+Left/Right
* Height adjustments
* Loop through screen height ratios: 3/4, 1/2, 1/4. hyper+Up/Down
* Set to horizontal half screen. hyperShift+Up/Down
### Testing
* Show window info. hyper+W
* Show notification. hyperShift+W
## macOS - Hammerspoon
[Download here](https://www.hammerspoon.org) or `brew install hammerspoon`.
Then symlink the configuration file:
```shell
bash mac/install.sh
```
## Windows - AutoHotkey v2
[Download here](https://www.autohotkey.com/) or `winget install --id AutoHotkey.AutoHotkey`.
If you want the program to start automatically at startup, run the following codes:
```powershell
powershell -ExecutionPolicy Bypass -File .\win\install.ps1
# To remove:
# start "$ENV:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup"
```
Optional: Disable Office key shortcuts (see [superuser](https://superuser.com/questions/1455857/how-to-disable-office-key-keyboard-shortcut-opening-office-app) and [ahk forum](https://www.autohotkey.com/boards/viewtopic.php?t=65573)):
```cmd
REG ADD HKCU\Software\Classes\ms-officeapp\Shell\Open\Command /t REG_SZ /d rundll32
:: REG DELETE HKCU\Software\Classes\ms-officeapp\Shell
```
## Ideas
This project is inspired by:
* Size looping behavior from [spectacle](https://github.com/eczarny/spectacle).
* Hammerspoon implementation reference from [this post](http://songchenwen.com/tech/2015/04/02/hammerspoon-mac-window-manager/).
* AutoHotkey implementation reference from [here](https://github.com/justcla/WindowHotKeys).