Update docs and example config

This commit is contained in:
Ottatop 2023-08-04 17:01:37 -05:00
parent 0190b66958
commit 4202454c43
3 changed files with 73 additions and 2 deletions

View file

@ -222,6 +222,13 @@ function output:set_loc(loc) end
---Set this output's location to the right of `op`.
---
--- top center bottom
--- ┌────────┬──────┐ ┌────────┐ ┌────────┐
--- │op │self │ │op ├──────┐ │op │
--- │ ├──────┘ │ │self │ │ ├──────┐
--- │ │ │ ├──────┘ │ │self │
--- └────────┘ └────────┘ └────────┴──────┘
---
---This will fail if `op` is an invalid output.
---@tparam Output op
---@tparam[opt="top"] string alignment One of `top`, `center`, or `bottom`. This is how you want to align the `self` output.
@ -230,6 +237,13 @@ function output:set_loc_right_of(op, alignment) end
---Set this output's location to the left of `op`.
---
--- top center bottom
--- ┌──────┬────────┐ ┌────────┐ ┌────────┐
--- │self │op │ ┌──────┤op │ │op │
--- └──────┤ │ │self │ │ ┌──────┤ │
--- │ │ └──────┤ │ │self │ │
--- └────────┘ └────────┘ └──────┴────────┘
---
---This will fail if `op` is an invalid output.
---@tparam Output op
---@tparam[opt="top"] string alignment One of `top`, `center`, or `bottom`. This is how you want to align the `self` output.
@ -238,6 +252,14 @@ function output:set_loc_left_of(op, alignment) end
---Set this output's location to the top of `op`.
---
--- left center right
--- ┌──────┐ ┌──────┐ ┌──────┐
--- │self │ │self │ │self │
--- ├──────┴─┐ ┌┴──────┴┐ ┌─┴──────┤
--- │op │ │op │ │op │
--- │ │ │ │ │ │
--- └────────┘ └────────┘ └────────┘
---
---This will fail if `op` is an invalid output.
---@tparam Output op
---@tparam[opt="left"] string alignment One of `left`, `center`, or `right`. This is how you want to align the `self` output.
@ -246,6 +268,14 @@ function output:set_loc_top_of(op, alignment) end
---Set this output's location to the bottom of `op`.
---
--- ┌────────┐ ┌────────┐ ┌────────┐
--- │op │ │op │ │op │
--- │ │ │ │ │ │
--- ├──────┬─┘ └┬──────┬┘ └─┬──────┤
--- │self │ │self │ │self │
--- └──────┘ └──────┘ └──────┘
--- left center right
---
---This will fail if `op` is an invalid output.
---@tparam Output op
---@tparam[opt="left"] string alignment One of `left`, `center`, or `right`. This is how you want to align the `self` output.

View file

@ -27,6 +27,15 @@ require("pinnacle").setup(function(pinnacle)
local terminal = "alacritty"
-- Outputs -----------------------------------------------------------------------
-- You can set your own monitor layout as I have done below for my monitors.
-- local lg = output.get_by_name("DP-2") --[[@as Output]]
-- local dell = output.get_by_name("DP-3") --[[@as Output]]
--
-- dell:set_loc_left_of(lg, "bottom")
-- Keybinds ----------------------------------------------------------------------
input.keybind({ mod_key, "Alt" }, keys.q, pinnacle.quit)

View file

@ -175,6 +175,14 @@ end
---Set this output's location to the right of the specified output.
---
---```
--- top center bottom
--- ┌────────┬──────┐ ┌────────┐ ┌────────┐
--- │op │self │ │op ├──────┐ │op │
--- │ ├──────┘ │ │self │ │ ├──────┐
--- │ │ │ ├──────┘ │ │self │
--- └────────┘ └────────┘ └────────┴──────┘
---```
---This will fail if `op` is an invalid output.
---@param op Output
---@param alignment AlignmentVertical? How you want to align the `self` output. Defaults to `top`.
@ -185,6 +193,14 @@ end
---Set this output's location to the left of the specified output.
---
---```
--- top center bottom
--- ┌──────┬────────┐ ┌────────┐ ┌────────┐
--- │self │op │ ┌──────┤op │ │op │
--- └──────┤ │ │self │ │ ┌──────┤ │
--- │ │ └──────┤ │ │self │ │
--- └────────┘ └────────┘ └──────┴────────┘
---```
---This will fail if `op` is an invalid output.
---@param op Output
---@param alignment AlignmentVertical? How you want to align the `self` output. Defaults to `top`.
@ -238,6 +254,15 @@ end
---Set this output's location to the top of the specified output.
---
---```
--- left center right
--- ┌──────┐ ┌──────┐ ┌──────┐
--- │self │ │self │ │self │
--- ├──────┴─┐ ┌┴──────┴┐ ┌─┴──────┤
--- │op │ │op │ │op │
--- │ │ │ │ │ │
--- └────────┘ └────────┘ └────────┘
---```
---This will fail if `op` is an invalid output.
---@param op Output
---@param alignment AlignmentHorizontal? How you want to align the `self` output. Defaults to `left`.
@ -248,6 +273,15 @@ end
---Set this output's location to the bottom of the specified output.
---
---```
--- ┌────────┐ ┌────────┐ ┌────────┐
--- │op │ │op │ │op │
--- │ │ │ │ │ │
--- ├──────┬─┘ └┬──────┬┘ └─┬──────┤
--- │self │ │self │ │self │
--- └──────┘ └──────┘ └──────┘
--- left center right
---```
---This will fail if `op` is an invalid output.
---@param op Output
---@param alignment AlignmentHorizontal? How you want to align the `self` output. Defaults to `left`.
@ -256,8 +290,6 @@ function output:set_loc_bottom_of(op, alignment)
set_loc_vertical(self, op, "bottom", alignment)
end
-- TODO: ----------------------------------------------------------------------------------
------------------------------------------------------
---Get an output by its name.