Skip to content

This is a group of Keyboard Maestro macros to move windows in a way inspired by Windows snap move shortcuts.

License

Notifications You must be signed in to change notification settings

doitian/km-windows-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Keyboard Maestro Windows Manager

This is a group of Keyboard Maestro macros to move windows in a way inspired by Windows snap move shortcuts.

The snap move macros have the same logic in the four different directions.

If the window moves along the directory, the side which first hit the screen boundary is named as near side, and the opposite side is the far side. For example, in the macro "Window Snap Right Ctrl + Option + Left", the right window side is the near side, and the left is the far side.

  • (1) If the near side does not near the screen boundary, move the near side along the direction until it meets the screen boundary.
+----------------------------+        +----------------------------+
|                            |        |                            |
|   +-------------------+    |        |   +------------------------+
|   |                   |    |        |   |                       ||
|   |                   |    |        |   |                       ||
|   |                   |    | +----> |   |                       ||
|   |                   |    |        |   |                       ||
|   +-------------------+    |        |   +------------------------+
|                            |        |                            |
|                            |        |                            |
+----------------------------+        +----------------------------+
  • (2) Otherwise, if the far side does not cross the screen mid line yet, move the far side along the direction until it meets the mid line.
+----------------------------+        +----------------------------+
|                            |        |                            |
|   +------------------------+        |              +-------------+
|   |                       ||        |              |            ||
|   |                       ||        |              |            ||
|   |                       || +----> |              |            ||
|   |                       ||        |              |            ||
|   +------------------------+        |              +-------------+
|                            |        |                            |
|                            |        |                            |
+----------------------------+        +----------------------------+
  • (3) Otherwise, if the window does not occupy the 95% of the space in the perpendicular direction yet, resize the window so it fills the half of the screen.
+----------------------------+        +----------------------------+
|                            |        |              +-------------|
|              +-------------+        |              |            ||
|              |            ||        |              |            ||
|              |            ||        |              |            ||
|              |            || +----> |              |            ||
|              |            ||        |              |            ||
|              +-------------+        |              |            ||
|                            |        |              |            ||
|                            |        |              +-------------|
+----------------------------+        +----------------------------+
  • (4) Otherwise, if there's a monitor along the direction, move the window to the next monitor.
     +----------------------------+ +----------------------------+
     |              +-------------| |                            |
     |              |            || |                            |
     |              |            || |                            |
     |              |            || |                            |
     |              |            || |                            | +-+
     |              |            || |                            |   |
     |              |            || |                            |   |
     |              |            || |                            |   |
     |              +-------------| |                            |   |
     +----------------------------+ +----------------------------+   |
                                                                     |
+--------------------------------------------------------------------+
|
|    +----------------------------+ +----------------------------+
|    |                            | |--------------+             |
|    |                            | ||             |             |
|    |                            | ||             |             |
|    |                            | ||             |             |
+->  |                            | ||             |             |
     |                            | ||             |             |
     |                            | ||             |             |
     |                            | ||             |             |
     |                            | |--------------+             |
     +----------------------------+ +----------------------------+

About

This is a group of Keyboard Maestro macros to move windows in a way inspired by Windows snap move shortcuts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published