#
hs.grid
Move/resize windows within a grid
The grid partitions your screens for the purposes of window management. The default layout of the grid is 3 columns by 3 rows. You can specify different grid layouts for different screens and/or screen resolutions.
Windows that are aligned with the grid have their location and size described as a cell
. Each cell is an hs.geometry
rect with these fields:
- x - The column of the left edge of the window
- y - The row of the top edge of the window
- w - The number of columns the window occupies
- h - The number of rows the window occupies
For a grid of 3x3:
- a cell
'0,0 1x1'
will be in the upper-left corner - a cell
'2,0 1x1'
will be in the upper-right corner - and so on...
Additionally, a modal keyboard driven interface for interactive resizing is provided via hs.grid.show()
;
The grid will be overlaid on the focused or frontmost window's screen with keyboard hints.
To resize/move the window, you can select the corner cells of the desired position.
For a move-only, you can select a cell and confirm with 'return'. The selected cell will become the new upper-left of the window.
You can also use the arrow keys to move the window onto adjacent screens, and the tab/shift-tab keys to cycle to the next/previous window.
Once you selected a cell, you can use the arrow keys to navigate through the grid. In this case, the grid will highlight the selected cells.
After highlighting enough cells, press enter to move/resize the window to the highlighted area.
#
API Overview
Variables - Configurable values
HINTS ui
Functions - API calls offered directly by the extension
adjustWindow get getCell getGrid getGridFrame hide maximizeWindow pushWindowDown pushWindowLeft pushWindowRight pushWindowUp resizeWindowShorter resizeWindowTaller resizeWindowThinner resizeWindowWider set setGrid setMargins show snap toggleShow