Move/resize your windows along a virtual and horizontal grid.
Usage: local grid = require "mjolnir.bg.grid"
The grid is an partition of your screen; by default it is 3x3, i.e. 3 cells wide by 3 cells tall.
Grid cells are just a table with keys: x, y, w, h
For a grid of 2x2:
mjolnir.bg.grid.GRIDHEIGHT = 3
The number of cells high the grid is.
mjolnir.bg.grid.GRIDWIDTH = 3
The number of cells wide the grid is.
mjolnir.bg.grid.MARGINX = 5
The margin between each window horizontally.
mjolnir.bg.grid.MARGINY = 5
The margin between each window vertically.
mjolnir.bg.grid.adjust_focused_window(fn)
Passes the focused window's cell to fn and uses the result as its new cell.
mjolnir.bg.grid.adjustheight(by)
Increases the grid by the given number of cells; may be negative
mjolnir.bg.grid.adjustwidth(by)
Widens the grid by the given number of cells; may be negative
mjolnir.bg.grid.get(win)
Gets the cell this window is on
mjolnir.bg.grid.maximize_window()
Maximizes the focused window along the given cell.
mjolnir.bg.grid.pushwindow_down()
Moves the focused window to the bottom half of the screen.
mjolnir.bg.grid.pushwindow_left()
Moves the focused window one cell to the left.
mjolnir.bg.grid.pushwindow_nextscreen()
Moves the focused window to the next screen, using its current cell on that screen.
mjolnir.bg.grid.pushwindow_prevscreen()
Moves the focused window to the previous screen, using its current cell on that screen.
mjolnir.bg.grid.pushwindow_right()
Moves the focused window one cell to the right.
mjolnir.bg.grid.pushwindow_up()
Moves the focused window to the top half of the screen.
mjolnir.bg.grid.resizewindow_shorter()
Resizes the focused window so its height is 1 grid count less.
mjolnir.bg.grid.resizewindow_taller()
Resizes the focused window so its height is 1 grid count higher.
mjolnir.bg.grid.resizewindow_thinner()
Resizes the focused window's right side to be one cell thinner.
mjolnir.bg.grid.resizewindow_wider()
Resizes the focused window's right side to be one cell wider.
mjolnir.bg.grid.set(win, grid, screen)
Sets the cell this window should be on
mjolnir.bg.grid.snap(win)
Snaps the window into a cell