mjolnir.bg.grid

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:

GRIDHEIGHT

mjolnir.bg.grid.GRIDHEIGHT = 3

The number of cells high the grid is.

GRIDWIDTH

mjolnir.bg.grid.GRIDWIDTH = 3

The number of cells wide the grid is.

MARGINX

mjolnir.bg.grid.MARGINX = 5

The margin between each window horizontally.

MARGINY

mjolnir.bg.grid.MARGINY = 5

The margin between each window vertically.

adjust_focused_window

mjolnir.bg.grid.adjust_focused_window(fn)

Passes the focused window's cell to fn and uses the result as its new cell.

adjustheight

mjolnir.bg.grid.adjustheight(by)

Increases the grid by the given number of cells; may be negative

adjustwidth

mjolnir.bg.grid.adjustwidth(by)

Widens the grid by the given number of cells; may be negative

get

mjolnir.bg.grid.get(win)

Gets the cell this window is on

maximize_window

mjolnir.bg.grid.maximize_window()

Maximizes the focused window along the given cell.

pushwindow_down

mjolnir.bg.grid.pushwindow_down()

Moves the focused window to the bottom half of the screen.

pushwindow_left

mjolnir.bg.grid.pushwindow_left()

Moves the focused window one cell to the left.

pushwindow_nextscreen

mjolnir.bg.grid.pushwindow_nextscreen()

Moves the focused window to the next screen, using its current cell on that screen.

pushwindow_prevscreen

mjolnir.bg.grid.pushwindow_prevscreen()

Moves the focused window to the previous screen, using its current cell on that screen.

pushwindow_right

mjolnir.bg.grid.pushwindow_right()

Moves the focused window one cell to the right.

pushwindow_up

mjolnir.bg.grid.pushwindow_up()

Moves the focused window to the top half of the screen.

resizewindow_shorter

mjolnir.bg.grid.resizewindow_shorter()

Resizes the focused window so its height is 1 grid count less.

resizewindow_taller

mjolnir.bg.grid.resizewindow_taller()

Resizes the focused window so its height is 1 grid count higher.

resizewindow_thinner

mjolnir.bg.grid.resizewindow_thinner()

Resizes the focused window's right side to be one cell thinner.

resizewindow_wider

mjolnir.bg.grid.resizewindow_wider()

Resizes the focused window's right side to be one cell wider.

set

mjolnir.bg.grid.set(win, grid, screen)

Sets the cell this window should be on

snap

mjolnir.bg.grid.snap(win)

Snaps the window into a cell