Skip to content
/ mrw Public

Mr. W - Move and resize windows on macOS/Windows

License

Notifications You must be signed in to change notification settings

wang-q/mrw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mr. W - Move and resize windows on macOS/Windows

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 🧫 🔬 🧬

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 or brew install hammerspoon.

Then symlink the configuration file:

bash mac/install.sh

Windows - AutoHotkey v2

Download here or winget install --id AutoHotkey.AutoHotkey.

If you want the program to start automatically at startup, run the following codes:

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 and ahk forum):

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.

  • Hammerspoon implementation reference from this post.

  • AutoHotkey implementation reference from here.