mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-25 09:59:21 +01:00
Remove doc dir
This commit is contained in:
parent
f9c35a752c
commit
a9fd0f725c
8 changed files with 0 additions and 1155 deletions
|
@ -1,7 +0,0 @@
|
|||
project = "Pinnacle"
|
||||
format = "markdown"
|
||||
description = "A very, VERY WIP Smithay-based Wayland compositor"
|
||||
boilerplate = true
|
||||
multimodule = true
|
||||
no_space_before_args = true
|
||||
style = true -- Use the ldoc.css in the current dir
|
|
@ -1,17 +0,0 @@
|
|||
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
---Input and keybinds
|
||||
---@module InputModule
|
||||
local input_module = {}
|
||||
|
||||
---Set a keybind. If called with an already existing keybind, it gets replaced.
|
||||
---
|
||||
---### Example
|
||||
--- -- Set `Super + Return` to open Alacritty
|
||||
--- input.keybind({ "Super" }, input.keys.Return, function()
|
||||
--- process.spawn("Alacritty")
|
||||
--- end)
|
||||
---@tparam Modifier[] modifiers Which modifiers need to be pressed for the keybind to trigger.
|
||||
---@tparam Keys key The key for the keybind.
|
||||
---@tparam function action What to do.
|
||||
function input_module.keybind(modifiers, key, action) end
|
|
@ -1,319 +0,0 @@
|
|||
/* BEGIN RESET
|
||||
|
||||
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.com/yui/license.html
|
||||
version: 2.8.2r1
|
||||
*/
|
||||
html {
|
||||
color: #e4e4e5;
|
||||
background: #202020; /* Background of page if it doesn't fill the screen */
|
||||
}
|
||||
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
fieldset,img {
|
||||
border: 0;
|
||||
}
|
||||
address,caption,cite,code,dfn,em,strong,th,var,optgroup {
|
||||
font-style: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
del,ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
li {
|
||||
margin-left: 20px;
|
||||
}
|
||||
caption,th {
|
||||
text-align: left;
|
||||
}
|
||||
h1,h2,h3,h4,h5,h6 {
|
||||
font-size: 100%;
|
||||
font-weight: bold;
|
||||
}
|
||||
q:before,q:after {
|
||||
content: '';
|
||||
}
|
||||
abbr,acronym {
|
||||
border: 0;
|
||||
font-variant: normal;
|
||||
}
|
||||
sup {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
sub {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
legend {
|
||||
color: #000;
|
||||
}
|
||||
input,button,textarea,select,optgroup,option {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-style: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
input,button,textarea,select {*font-size:100%;
|
||||
}
|
||||
/* END RESET */
|
||||
|
||||
body { /* Body of window (makes it look like sidebars) */
|
||||
margin-left: 1em;
|
||||
margin-right: 1em;
|
||||
font-family: arial, helvetica, geneva, sans-serif;
|
||||
background-color: #202020; margin: 0px;
|
||||
}
|
||||
|
||||
code, tt { font-family: "JetBrains Mono", "Consolas", monospace; font-size: 1em; }
|
||||
span.parameter { font-family: "JetBrains Mono", "Consolas", monospace; }
|
||||
span.parameter:after { content:":"; }
|
||||
span.types:before { content:"("; }
|
||||
span.types:after { content:")"; }
|
||||
.type { font-weight: bold; font-style:italic }
|
||||
|
||||
body, p, td, th { font-size: 1em; line-height: 1.2em;}
|
||||
|
||||
p, ul { margin: 10px 0 0 0px;}
|
||||
|
||||
strong { font-weight: bold;}
|
||||
|
||||
em { font-style: italic;}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
margin: 20px 0 20px 0;
|
||||
}
|
||||
h2, h3, h4 { margin: 15px 0 10px 0; }
|
||||
h2 { font-size: 1.25em; }
|
||||
h3 { font-size: 1.15em; }
|
||||
h4 { font-size: 1.06em; }
|
||||
|
||||
a:link { font-weight: bold; color: #33b1ff; text-decoration: none; }
|
||||
a:visited { font-weight: bold; color: #33b1ff; text-decoration: none; }
|
||||
a:link:hover { text-decoration: underline; }
|
||||
|
||||
hr {
|
||||
color:#cccccc;
|
||||
background: #00007f;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
blockquote { margin-left: 3em; }
|
||||
|
||||
ul { list-style-type: disc; }
|
||||
|
||||
p.name {
|
||||
font-family: "JetBrains Mono", "Andale Mono", monospace;
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #2a2a2a;
|
||||
border: 1px solid #505050;
|
||||
padding: 10px;
|
||||
margin: 10px 0 10px 0;
|
||||
overflow: auto;
|
||||
font-family: "JetBrains Mono", "Andale Mono", monospace;
|
||||
}
|
||||
|
||||
pre.example { /* Usage blocks */
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
table.index { border: 1px #00007f; }
|
||||
table.index td { text-align: left; vertical-align: top; }
|
||||
|
||||
#container {
|
||||
/* margin-left: 1em; */
|
||||
/* margin-right: 1em; */
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
#product {
|
||||
text-align: center;
|
||||
border-bottom: 0px solid #cccccc;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#product big {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
#main {
|
||||
background-color: #101010;
|
||||
border-left: 0px solid #cccccc;
|
||||
}
|
||||
|
||||
#navigation { /* Sidebar */
|
||||
float: left;
|
||||
width: 20%;
|
||||
vertical-align: top;
|
||||
background-color: #101010;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
#navigation h1 {
|
||||
padding: 0.2em;
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
#navigation h2 { /* Sidebar subheaders */
|
||||
background-color:#2a2a2a;
|
||||
font-size:1.1em;
|
||||
color:#e4e4e5;
|
||||
text-align: left;
|
||||
padding:0.2em;
|
||||
margin: 0px;
|
||||
border-top:0px solid #dddddd;
|
||||
border-bottom:0px solid #dddddd;
|
||||
}
|
||||
|
||||
#navigation ul
|
||||
{
|
||||
font-size:1em;
|
||||
list-style-type: none;
|
||||
margin: 1px 1px 10px 1px;
|
||||
}
|
||||
|
||||
#navigation li {
|
||||
text-indent: -1em;
|
||||
display: block;
|
||||
margin: 3px 0px 0px 22px;
|
||||
}
|
||||
|
||||
#navigation li li a {
|
||||
margin: 0px 3px 0px -1em;
|
||||
}
|
||||
|
||||
#content { /* Content background (the stuff with the actual docs) */
|
||||
margin-left: 20%;
|
||||
width: 80% - 32px;
|
||||
border-left: 0px solid #cccccc;
|
||||
border-right: 0px solid #cccccc;
|
||||
background-color: #202020;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
#content h1 {
|
||||
/* margin: 0%; */
|
||||
}
|
||||
|
||||
#about { /* The about footer */
|
||||
clear: both;
|
||||
/* margin: 5px; */
|
||||
border-top: 2px solid #505050;
|
||||
background-color: #202020;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#about i { /* The two text thingys in the footer */
|
||||
padding-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
@media print {
|
||||
body {
|
||||
font: 12pt "Times New Roman", "TimeNR", Times, serif;
|
||||
}
|
||||
a { font-weight: bold; color: #004080; text-decoration: underline; }
|
||||
|
||||
#main {
|
||||
background-color: #ffffff;
|
||||
border-left: 0px;
|
||||
}
|
||||
|
||||
#container {
|
||||
margin-left: 2%;
|
||||
margin-right: 2%;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#content {
|
||||
padding: 1em;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
#navigation {
|
||||
display: none;
|
||||
}
|
||||
pre.example {
|
||||
font-family: "JetBrains Mono", "Andale Mono", monospace;
|
||||
font-size: 10pt;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
}
|
||||
|
||||
table.module_list {
|
||||
border-width: 0px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.module_list td {
|
||||
border-width: 2px;
|
||||
padding: 3px;
|
||||
border-style: solid;
|
||||
border-color: #505050;
|
||||
}
|
||||
table.module_list td.name { background-color: #2a2a2a; min-width: 200px; vertical-align: top; } /* Modules/Classes Name section */
|
||||
table.module_list td.summary { background-color: #161616; width: 80%; vertical-align: top; } /* Summary section */
|
||||
|
||||
/* Same stuff but for function tables */
|
||||
table.function_list {
|
||||
border-width: 0px;
|
||||
border-style: solid;
|
||||
border-color: #cccccc;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.function_list td {
|
||||
border-width: 2px;
|
||||
padding: 3px;
|
||||
border-style: solid;
|
||||
border-color: #505050;
|
||||
}
|
||||
table.function_list td.name { background-color: #2a2a2a; min-width: 200px; vertical-align: top; }
|
||||
table.function_list td.summary { width: 100%; vertical-align: top; }
|
||||
|
||||
ul.nowrap {
|
||||
overflow:auto;
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
|
||||
dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
|
||||
dl.table h3, dl.function h3 {font-size: .95em;}
|
||||
|
||||
/* stop sublists from having initial vertical space */
|
||||
ul ul { margin-top: 0px; }
|
||||
ol ul { margin-top: 0px; }
|
||||
ol ol { margin-top: 0px; }
|
||||
ul ol { margin-top: 0px; }
|
||||
|
||||
/* make the target distinct; helps when we're navigating to a function */
|
||||
a:target + * {
|
||||
background-color: #535353;
|
||||
}
|
||||
|
||||
/* styles for prettification of source */
|
||||
pre .comment { color: #9e9fa0; }
|
||||
pre .constant { color: #5ae0df; }
|
||||
pre .escape { color: #2dc7c4; }
|
||||
pre .keyword { color: #be95ff; font-weight: bold; }
|
||||
pre .library { color: #ee5396; }
|
||||
pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
|
||||
pre .string { color: #25be6a; }
|
||||
pre .number { color: #3ddbd9; }
|
||||
pre .function-name { color: #8cb6ff; }
|
||||
pre .operator { color: #b6b8bb; font-weight: bold; }
|
||||
pre .preprocessor, pre .prepro { color: #ff91c1; }
|
||||
pre .global { color: #ee5396; }
|
||||
pre .user-keyword { color: #ee5396; }
|
||||
pre .prompt { color: #558817; }
|
||||
pre .url { color: #5ae0df; text-decoration: underline; }
|
||||
|
|
@ -1,283 +0,0 @@
|
|||
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
---Output management
|
||||
---@module OutputModule
|
||||
local output_module = {}
|
||||
|
||||
---Get an output by its name.
|
||||
---
|
||||
---"Name" in this sense does not mean its model or manufacturer;
|
||||
---rather, "name" is the name of the connector the output is connected to.
|
||||
---This should be something like "HDMI-A-0", "eDP-1", or similar.
|
||||
---
|
||||
---@usage
|
||||
---local monitor = output.get_by_name("DP-1")
|
||||
---print(monitor.name) -- should print `DP-1`
|
||||
---@tparam string name The name of the output.
|
||||
---@treturn Output|nil output The output, or nil if none have the provided name.
|
||||
function output_module.get_by_name(name) end
|
||||
|
||||
---Note: This may or may not be what is reported by other monitor listing utilities. Pinnacle currently fails to pick up one of my monitors' models when it is correctly picked up by tools like wlr-randr. I'll fix this in the future.
|
||||
---
|
||||
---Get outputs by their model.
|
||||
---This is something like "DELL E2416H" or whatever gibberish monitor manufacturers call their displays.
|
||||
---@tparam string model The model of the output(s).
|
||||
---@treturn Output[] outputs All outputs with this model.
|
||||
function output_module.get_by_model(model) end
|
||||
|
||||
---Get outputs by their resolution.
|
||||
---
|
||||
---@tparam integer width The width of the outputs, in pixels.
|
||||
---@tparam integer height The height of the outputs, in pixels.
|
||||
---@treturn Output[] outputs All outputs with this resolution.
|
||||
function output_module.get_by_res(width, height) end
|
||||
|
||||
---Get the currently focused output. This is currently implemented as the one with the cursor on it.
|
||||
---
|
||||
---This function may return nil, which means you may get a warning if you try to use it without checking for nil.
|
||||
---Usually this function will not be nil unless you unplug all monitors, so instead of checking,
|
||||
---you can ignore the warning by either forcing the type to be non-nil with an inline comment:
|
||||
--- local op = output.get_focused() --[[@as Output]]
|
||||
---or by disabling nil check warnings for the line:
|
||||
--- local op = output.get_focused()
|
||||
--- ---@diagnostic disable-next-line:need-check-nil
|
||||
--- local tags_on_output = op:tags()
|
||||
---Type checking done by Lua LS isn't perfect.
|
||||
---Note that directly using the result of this function inline will *not* raise a warning, so be careful.
|
||||
--- local tags = output.get_focused():tags() -- will NOT warn for nil
|
||||
---@treturn Output|nil output The output, or nil if none are focused.
|
||||
function output_module.get_focused() end
|
||||
|
||||
---Connect a function to be run on all current and future outputs.
|
||||
---
|
||||
---When called, `connect_for_all` will immediately run `func` with all currently connected outputs.
|
||||
---If a new output is connected, `func` will also be called with it.
|
||||
---
|
||||
---Please note: this function will be run *after* Pinnacle processes your entire config.
|
||||
---For example, if you define tags in `func` but toggle them directly after `connect_for_all`, nothing will happen as the tags haven't been added yet.
|
||||
---@tparam function func The function that will be run. This takes an `Output` object.
|
||||
function output_module.connect_for_all(func) end
|
||||
|
||||
---Get the output the specified tag is on.
|
||||
---@tparam Tag tag
|
||||
---@treturn Output|nil
|
||||
---@see TagModule.output
|
||||
---@see Tag.output
|
||||
function output_module.get_for_tag(tag) end
|
||||
|
||||
---Get the specified output's make.
|
||||
---@tparam Output op
|
||||
---@treturn string|nil
|
||||
---@see Output.make
|
||||
function output_module.make(op) end
|
||||
|
||||
---Get the specified output's model.
|
||||
---@tparam Output op
|
||||
---@treturn string|nil
|
||||
---@see Output.model
|
||||
function output_module.model(op) end
|
||||
|
||||
---Get the specified output's location in the global space, in pixels.
|
||||
---@tparam Output op
|
||||
---@treturn table|nil { x: integer, y: integer }
|
||||
---@see Output.loc
|
||||
function output_module.loc(op) end
|
||||
|
||||
---Get the specified output's resolution in pixels.
|
||||
---@tparam Output op
|
||||
---@treturn table|nil { w: integer, h: integer }
|
||||
---@see Output.res
|
||||
function output_module.res(op) end
|
||||
|
||||
---Get the specified output's refresh rate in millihertz.
|
||||
---For example, 60Hz will be returned as 60000.
|
||||
---@tparam Output op
|
||||
---@treturn integer|nil
|
||||
---@see Output.refresh_rate
|
||||
function output_module.refresh_rate(op) end
|
||||
|
||||
---Get the specified output's physical size in millimeters.
|
||||
---@tparam Output op
|
||||
---@treturn table|nil { w: integer, h: integer }
|
||||
---@see Output.physical_size
|
||||
function output_module.physical_size(op) end
|
||||
|
||||
---Get whether or not the specified output is focused. This is currently defined as having the cursor on it.
|
||||
---@tparam Output op
|
||||
---@treturn boolean|nil
|
||||
---@see Output.focused
|
||||
function output_module.focused(op) end
|
||||
|
||||
---Get the specified output's tags.
|
||||
---@tparam Output op
|
||||
---@see TagModule.get_on_output
|
||||
---@see Output.tags
|
||||
function output_module.tags(op) end
|
||||
|
||||
---Add tags to the specified output.
|
||||
---@tparam Output op
|
||||
---@tparam string ... The names of the tags you want to add. You can also pass in a table.
|
||||
---@see TagModule.add
|
||||
---@see Output.add_tags
|
||||
function output_module.add_tags(op, ...) end
|
||||
|
||||
---Set the specified output's location.
|
||||
---
|
||||
---@usage
|
||||
----- Assuming DP-1 is 2560x1440 and DP-2 is 1920x1080...
|
||||
---local dp1 = output.get_by_name("DP-1")
|
||||
---local dp2 = output.get_by_name("DP-2")
|
||||
---
|
||||
----- Place DP-2 to the left of DP-1, top borders aligned
|
||||
---output.set_loc(dp1, { x = 1920, y = 0 })
|
||||
---output.set_loc(dp2, { x = 0, y = 0 })
|
||||
---
|
||||
----- Do the same as above, with a different origin
|
||||
---output.set_loc(dp1, { x = 0, y = 0 })
|
||||
---output.set_loc(dp2, { x = -1920, y = 0 })
|
||||
---
|
||||
----- Place DP-2 to the right of DP-1, bottom borders aligned
|
||||
---output.set_loc(dp1, { x = 0, y = 0 })
|
||||
---output.set_loc(dp2, { x = 2560, y = 1440 - 1080 })
|
||||
---@tparam Output op
|
||||
---@tparam table loc A table of the form `{ x: integer?, y: integer? }`
|
||||
function output_module.set_loc(op, loc) end
|
||||
|
||||
----------------------------------------------------------
|
||||
|
||||
---The output object.
|
||||
---@classmod Output
|
||||
local output = {}
|
||||
|
||||
---Get this output's name. This is something like "eDP-1" or "HDMI-A-0".
|
||||
---@treturn string
|
||||
function output:name() end
|
||||
|
||||
---Get all tags on this output.
|
||||
---@treturn Tag[]
|
||||
---@see OutputModule.tags
|
||||
function output:tags() end
|
||||
|
||||
---Add tags to this output.
|
||||
---@tparam string ... The names of the tags you want to add. You can also pass in a table.
|
||||
---@see OutputModule.add_tags
|
||||
function output:add_tags(...) end
|
||||
|
||||
---Get this output's make.
|
||||
---@treturn string|nil
|
||||
---@see OutputModule.make
|
||||
function output:make() end
|
||||
|
||||
---Get this output's model.
|
||||
---@treturn string|nil
|
||||
---@see OutputModule.model
|
||||
function output:model() end
|
||||
|
||||
---Get this output's location in the global space, in pixels.
|
||||
---@treturn table|nil { x: integer, y: integer }
|
||||
---@see OutputModule.loc
|
||||
function output:loc() end
|
||||
|
||||
---Get this output's resolution in pixels.
|
||||
---@treturn table|nil { w: integer, h: integer }
|
||||
---@see OutputModule.res
|
||||
function output:res() end
|
||||
|
||||
---Get this output's refresh rate in millihertz.
|
||||
---For example, 60Hz will be returned as 60000.
|
||||
---@treturn integer|nil
|
||||
---@see OutputModule.refresh_rate
|
||||
function output:refresh_rate() end
|
||||
|
||||
---Get this output's physical size in millimeters.
|
||||
---@treturn table|nil { w: integer, h: integer }
|
||||
---@see OutputModule.physical_size
|
||||
function output:physical_size() end
|
||||
|
||||
---Get whether or not this output is focused. This is currently defined as having the cursor on it.
|
||||
---@treturn boolean|nil
|
||||
---@see OutputModule.focused
|
||||
function output:focused() end
|
||||
|
||||
---Set this output's location.
|
||||
---
|
||||
---@usage
|
||||
--- -- Assuming DP-1 is 2560x1440 and DP-2 is 1920x1080...
|
||||
---local dp1 = output.get_by_name("DP-1")
|
||||
---local dp2 = output.get_by_name("DP-2")
|
||||
---
|
||||
--- -- Place DP-2 to the left of DP-1, top borders aligned
|
||||
---dp1:set_loc({ x = 1920, y = 0 })
|
||||
---dp2:set_loc({ x = 0, y = 0 })
|
||||
---
|
||||
--- -- Do the same as above, with a different origin
|
||||
---dp1:set_loc({ x = 0, y = 0 })
|
||||
---dp2:set_loc({ x = -1920, y = 0 })
|
||||
---
|
||||
--- -- Place DP-2 to the right of DP-1, bottom borders aligned
|
||||
---dp1:set_loc({ x = 0, y = 0 })
|
||||
---dp2:set_loc({ x = 2560, y = 1440 - 1080 })
|
||||
---@tparam table loc A table of the form `{ x: integer?, y: integer? }`
|
||||
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.
|
||||
---@see Output.set_loc
|
||||
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.
|
||||
---@see Output.set_loc
|
||||
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.
|
||||
---@see Output.set_loc
|
||||
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.
|
||||
---@see Output.set_loc
|
||||
function output:set_loc_bottom_of(op, alignment) end
|
|
@ -1,35 +0,0 @@
|
|||
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
---The configuration entry point.
|
||||
---@module PinnacleModule
|
||||
local pinnacle = {
|
||||
---Input and keybinds
|
||||
---@tparam InputModule input
|
||||
---@see InputModule
|
||||
input = nil,
|
||||
---Window management
|
||||
---@tparam WindowModule window
|
||||
---@see WindowModule
|
||||
window = nil,
|
||||
---Process management
|
||||
---@tparam ProcessModule process
|
||||
---@see ProcessModule
|
||||
process = nil,
|
||||
---Tag management
|
||||
---@tparam TagModule tag
|
||||
---@see TagModule
|
||||
tag = nil,
|
||||
---Output management
|
||||
---@tparam OutputModule output
|
||||
---@see OutputModule
|
||||
output = nil,
|
||||
}
|
||||
|
||||
---Quit Pinnacle.
|
||||
function pinnacle.quit() end
|
||||
|
||||
---Configure Pinnacle.
|
||||
---
|
||||
---You should put mostly eveything into the config_func to avoid invalid state.
|
||||
---@tparam function config_func A function that takes in the `Pinnacle` table.
|
||||
function pinnacle.setup(config_func) end
|
|
@ -1,29 +0,0 @@
|
|||
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
---This file houses LDoc documentation with dummy functions.---
|
||||
|
||||
---Process management
|
||||
---@module ProcessModule
|
||||
local process_module = {}
|
||||
|
||||
---Spawn a process with an optional callback for its stdout, stderr, and exit information.
|
||||
---
|
||||
---`callback` has the following parameters:<br>
|
||||
--- - `stdout` - The process's stdout printed this line.<br>
|
||||
--- - `stderr` - The process's stderr printed this line.<br>
|
||||
--- - `exit_code` - The process exited with this code.<br>
|
||||
--- - `exit_msg` - The process exited with this message.<br>
|
||||
---@tparam string|string[] command The command as one whole string or a table of each of its arguments
|
||||
---@tparam function callback A callback to do something whenever the process's stdout or stderr print a line, or when the process exits.
|
||||
function process_module.spawn(command, callback) end
|
||||
|
||||
---Spawn a process only if it isn't already running, with an optional callback for its stdout, stderr, and exit information.
|
||||
---
|
||||
---`callback` has the following parameters:<br>
|
||||
--- - `stdout` - The process's stdout printed this line.<br>
|
||||
--- - `stderr` - The process's stderr printed this line.<br>
|
||||
--- - `exit_code` - The process exited with this code.<br>
|
||||
--- - `exit_msg` - The process exited with this message.<br>
|
||||
---@tparam string|string[] command The command as one whole string or a table of each of its arguments
|
||||
---@tparam function callback A callback to do something whenever the process's stdout or stderr print a line, or when the process exits.
|
||||
function process_module.spawn_once(command, callback) end
|
|
@ -1,154 +0,0 @@
|
|||
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
---Tag management
|
||||
---@module TagModule
|
||||
local tag_module = {}
|
||||
|
||||
---Add tags to the specified output.
|
||||
---
|
||||
---@usage
|
||||
---local op = output.get_by_name("DP-1")
|
||||
---if op ~= nil then
|
||||
--- tag.add(op, "1", "2", "3", "4", "5") -- Add tags with names 1-5
|
||||
---end
|
||||
--- -- You can also pass in a table.
|
||||
---local tags = {"Terminal", "Browser", "Code", "Potato", "Email"}
|
||||
---tag.add(op, tags) -- Add tags with those names
|
||||
---@tparam Output output The output you want these tags to be added to.
|
||||
---@tparam string ... The names of the new tags you want to add.
|
||||
---@see Output.add_tags
|
||||
function tag_module.add(output, ...) end
|
||||
|
||||
---Toggle a tag on the specified output. If `output` isn't specified, toggle it on the currently focused output instead.
|
||||
---
|
||||
---@usage
|
||||
--- -- Assuming all tags are toggled off...
|
||||
---local op = output.get_by_name("DP-1")
|
||||
---tag.toggle("1", op)
|
||||
---tag.toggle("2", op)
|
||||
--- -- will cause windows on both tags 1 and 2 to be displayed at the same time.
|
||||
---@tparam string name The name of the tag.
|
||||
---@tparam ?Output output The output.
|
||||
---@see Tag.toggle
|
||||
function tag_module.toggle(name, output) end
|
||||
|
||||
---Switch to a tag on the specified output, deactivating any other active tags on it.
|
||||
---If `output` is not specified, this uses the currently focused output instead.
|
||||
---Alternatively, provide a tag object instead of a name and output.
|
||||
---
|
||||
---This is used to replicate what a traditional workspace is on some other Wayland compositors.
|
||||
---
|
||||
---@usage
|
||||
--- -- Switches to and displays *only* windows on tag `3` on the focused output.
|
||||
---tag.switch_to("3")
|
||||
---@tparam string name The name of the tag.
|
||||
---@tparam ?Output output The output.
|
||||
---@see Tag.switch_to
|
||||
function tag_module.switch_to(name, output) end
|
||||
|
||||
---Set a layout for the tag on the specified output. If no output is provided, set it for the tag on the currently focused one.
|
||||
---Alternatively, provide a tag object instead of a name and output.
|
||||
---
|
||||
---@usage
|
||||
--- -- Set tag `1` on `DP-1` to the `Dwindle` layout
|
||||
--- tag.set_layout("1", "Dwindle", output.get_by_name("DP-1"))
|
||||
---
|
||||
--- -- Do the same as above. Note: if you have more than one tag named `1` then this picks the first one.
|
||||
---local t = tag.get_by_name("1")[1]
|
||||
---tag.set_layout(t, "Dwindle")
|
||||
---@tparam string name The name of the tag.
|
||||
---@tparam Layout layout The layout.
|
||||
---@tparam ?Output output The output.
|
||||
---@see Tag.set_layout
|
||||
function tag_module.set_layout(name, layout, output) end
|
||||
|
||||
---Get all tags on the specified output.
|
||||
---
|
||||
---@usage
|
||||
---local op = output.get_focused()
|
||||
---if op ~= nil then
|
||||
--- local tags = tag.get_on_output(op) -- All tags on the focused output
|
||||
---end
|
||||
---@tparam Output output
|
||||
---@treturn Tag[]
|
||||
---@see Output.tags
|
||||
function tag_module.get_on_output(output) end
|
||||
|
||||
---Get all tags with this name across all outputs.
|
||||
---
|
||||
---@usage
|
||||
--- -- Given one monitor with the tags "OBS", "OBS", "VSCode", and "Spotify"...
|
||||
---local tags = tag.get_by_name("OBS")
|
||||
--- -- ...will have 2 tags in `tags`, while...
|
||||
---local no_tags = tag.get_by_name("Firefox")
|
||||
--- -- ...will have `no_tags` be empty.
|
||||
---@tparam string name The name of the tag(s) you want.
|
||||
---@treturn Tag[]
|
||||
function tag_module.get_by_name(name) end
|
||||
|
||||
---Get all tags across all outputs.
|
||||
---
|
||||
---@usage
|
||||
--- -- With two monitors with the same tags: "1", "2", "3", "4", and "5"...
|
||||
---local tags = tag.get_all()
|
||||
--- -- ...`tags` should have 10 tags, with 5 pairs of those names across both outputs.
|
||||
---@treturn Tag[]
|
||||
function tag_module.get_all() end
|
||||
|
||||
---Get the specified tag's name.
|
||||
---
|
||||
---@usage
|
||||
--- -- Assuming the tag `Terminal` exists...
|
||||
---print(tag.name(tag.get_by_name("Terminal")[1]))
|
||||
--- -- ...should print `Terminal`.
|
||||
---@tparam Tag t
|
||||
---@treturn string|nil
|
||||
---@see Tag.name
|
||||
function tag_module.name(t) end
|
||||
|
||||
---Get whether or not the specified tag is active.
|
||||
---@tparam Tag t
|
||||
---@treturn boolean|nil
|
||||
---@see Tag.active
|
||||
function tag_module.active(t) end
|
||||
|
||||
---Get the output the specified tag is on.
|
||||
---@tparam Tag t
|
||||
---@treturn Output|nil
|
||||
---@see OutputModule.get_for_tag
|
||||
---@see Tag.output
|
||||
function tag_module.output(t) end
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
---The tag object.
|
||||
---@classmod Tag
|
||||
local tag = {}
|
||||
|
||||
---Get this tag's active status.
|
||||
---@treturn boolean|nil active `true` if the tag is active, `false` if not, and `nil` if the tag doesn't exist.
|
||||
---@see TagModule.active
|
||||
function tag:active() end
|
||||
|
||||
---Get this tag's name.
|
||||
---@treturn string|nil name The name of this tag, or nil if it doesn't exist.
|
||||
---@see TagModule.name
|
||||
function tag:name() end
|
||||
|
||||
---Get this tag's output.
|
||||
---@treturn Output|nil output The output this tag is on, or nil if the tag doesn't exist.
|
||||
---@see TagModule.output
|
||||
function tag:output() end
|
||||
|
||||
---Switch to this tag.
|
||||
---@see TagModule.switch_to
|
||||
function tag:switch_to() end
|
||||
|
||||
---Toggle this tag.
|
||||
---@see TagModule.toggle
|
||||
function tag:toggle() end
|
||||
|
||||
---Set this tag's layout.
|
||||
---@tparam Layout layout
|
||||
---@see TagModule.set_layout
|
||||
function tag:set_layout(layout) end
|
|
@ -1,311 +0,0 @@
|
|||
-- SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
---Window management
|
||||
---@module WindowModule
|
||||
local window_module = {}
|
||||
|
||||
---Get all windows with the specified class (usually the name of the application).
|
||||
---@tparam string class The class. For example, Alacritty's class is "Alacritty".
|
||||
---@treturn Window[]
|
||||
function window_module.get_by_class(class) end
|
||||
|
||||
---Get all windows with the specified title.
|
||||
---@tparam string title The title.
|
||||
---@treturn Window[]
|
||||
function window_module.get_by_title(title) end
|
||||
|
||||
---Get the currently focused window.
|
||||
---@treturn Window|nil
|
||||
function window_module.get_focused() end
|
||||
|
||||
---Get all windows.
|
||||
---@treturn Window[]
|
||||
function window_module.get_all() end
|
||||
|
||||
---Toggle the tag with the given name and (optional) output for the specified window.
|
||||
---@tparam Window w
|
||||
---@tparam Tag|table|string t A tag object, string of a name, `{ [1]: string, [2]: (string|Output)? }`, or `{ name: string, output: (string|Output)? }`
|
||||
---@see Window.toggle_tag
|
||||
function window_module.toggle_tag(w, t) end
|
||||
|
||||
---Move the specified window to the tag with the given name and (optional) output.
|
||||
---@tparam Window w
|
||||
---@tparam Tag|table|string t A tag object, string of a name, `{ [1]: string, [2]: (string|Output)? }`, or `{ name: string, output: (string|Output)? }`
|
||||
---@see Window.move_to_tag
|
||||
function window_module.move_to_tag(w, t) end
|
||||
|
||||
---Set the specified window's size.
|
||||
---
|
||||
---@usage
|
||||
---local win = window.get_focused()
|
||||
---if win ~= nil then
|
||||
--- window.set_size(win, { w = 500, h = 500 }) -- make the window square and 500 pixels wide/tall
|
||||
--- window.set_size(win, { h = 300 }) -- keep the window's width but make it 300 pixels tall
|
||||
--- window.set_size(win, {}) -- do absolutely nothing useful
|
||||
---end
|
||||
---@tparam Window win
|
||||
---@tparam table size A table of the form { w: integer?, h: integer? }
|
||||
---@see Window.set_size
|
||||
function window_module.set_size(win, size) end
|
||||
|
||||
---Close the specified window.
|
||||
---
|
||||
---This only sends a close *event* to the window and is the same as just clicking the X button in the titlebar.
|
||||
---This will trigger save prompts in applications like GIMP.
|
||||
---
|
||||
---@usage
|
||||
---local win = window.get_focused()
|
||||
---if win ~= nil then
|
||||
--- window.close(win) -- close the currently focused window
|
||||
---end
|
||||
---@tparam Window win
|
||||
---@see Window.close
|
||||
function window_module.close(win) end
|
||||
|
||||
---Get the specified window's size.
|
||||
---
|
||||
---@usage
|
||||
--- -- With a 4K monitor, given a focused fullscreen window `win`...
|
||||
---local size = window.size(win)
|
||||
--- -- ...should have size equal to `{ w = 3840, h = 2160 }`.
|
||||
---@tparam Window win
|
||||
---@treturn table|nil size The size of the window in the form { w: integer, h: integer }, or nil if it doesn't exist.
|
||||
---@see Window.size
|
||||
function window_module.size(win) end
|
||||
|
||||
---Get the specified window's location in the global space.
|
||||
---
|
||||
---Think of your monitors as being laid out on a big sheet.
|
||||
---The top left of the sheet if you trim it down is (0, 0).
|
||||
---The location of this window is relative to that point.
|
||||
---
|
||||
---@usage
|
||||
--- -- With two 1080p monitors side by side and set up as such,
|
||||
--- -- if a window `win` is fullscreen on the right one...
|
||||
---local loc = window.loc(win)
|
||||
--- -- ...should have loc equal to `{ x = 1920, y = 0 }`.
|
||||
---@tparam Window win
|
||||
---@treturn table|nil loc The location of the window in the form { x: integer, y: integer }, or nil if it's not on-screen or alive.
|
||||
---@see Window.loc
|
||||
function window_module.loc(win) end
|
||||
|
||||
---Get the specified window's class. This is usually the name of the application.
|
||||
---
|
||||
---@usage
|
||||
--- -- With Alacritty focused...
|
||||
---local win = window.get_focused()
|
||||
---if win ~= nil then
|
||||
--- print(window.class(win))
|
||||
---end
|
||||
--- -- ...should print "Alacritty".
|
||||
---@tparam Window win
|
||||
---@treturn string|nil class This window's class, or nil if it doesn't exist.
|
||||
---@see Window.class
|
||||
function window_module.class(win) end
|
||||
|
||||
---Get the specified window's title.
|
||||
---
|
||||
---@usage
|
||||
--- -- With Alacritty focused...
|
||||
---local win = window.get_focused()
|
||||
---if win ~= nil then
|
||||
--- print(window.title(win))
|
||||
---end
|
||||
--- -- ...should print the directory Alacritty is in or what it's running (what's in its title bar).
|
||||
---@tparam Window win
|
||||
---@treturn string|nil title This window's title, or nil if it doesn't exist.
|
||||
---@see Window.title
|
||||
function window_module.title(win) end
|
||||
|
||||
---Toggle `win`'s floating status.
|
||||
---
|
||||
---When used on a floating window, this will change it to tiled, and vice versa.
|
||||
---
|
||||
---When used on a fullscreen or maximized window, this will still change its
|
||||
---underlying floating/tiled status.
|
||||
---@tparam Window win
|
||||
function window_module.toggle_floating(win) end
|
||||
|
||||
---Toggle `win`'s fullscreen status.
|
||||
---
|
||||
---When used on a fullscreen window, this will change the window back to
|
||||
---floating or tiled.
|
||||
---
|
||||
---When used on a non-fullscreen window, it becomes fullscreen.
|
||||
---@tparam Window win
|
||||
function window_module.toggle_fullscreen(win) end
|
||||
|
||||
---Toggle `win`'s maximized status.
|
||||
---
|
||||
---When used on a maximized window, this will change the window back to
|
||||
---floating or tiled.
|
||||
---
|
||||
---When used on a non-maximized window, it becomes maximized.
|
||||
---@tparam Window win
|
||||
function window_module.toggle_maximized(win) end
|
||||
|
||||
---Get whether or not this window is focused.
|
||||
---
|
||||
---@usage
|
||||
---local win = window.get_focused()
|
||||
---if win ~= nil then
|
||||
--- print(window.focused(win)) -- Should print `true`
|
||||
---end
|
||||
---@tparam Window win
|
||||
---@treturn boolean|nil floating `true` if it's floating, `false` if it's tiled, or nil if it doesn't exist.
|
||||
---@see Window.focused
|
||||
function window_module.focused(win) end
|
||||
|
||||
---Get whether or not `win` is floating (true) or tiled (false).
|
||||
---@treturn boolean|nil
|
||||
function window_module.floating(win) end
|
||||
|
||||
---Get whether or not `win` is fullscreen.
|
||||
---@treturn boolean|nil
|
||||
function window_module.fullscreen(win) end
|
||||
|
||||
---Get whether or not `win` is maximized.
|
||||
---@treturn boolean|nil
|
||||
function window_module.maximized(win) end
|
||||
|
||||
--------------------------------------------------------
|
||||
|
||||
---The window object.
|
||||
---@classmod Window
|
||||
local window = {}
|
||||
|
||||
---Set this window's size.
|
||||
---
|
||||
---@usage
|
||||
---window.get_focused():set_size({ w = 500, h = 500 }) -- make the window square and 500 pixels wide/tall
|
||||
---window.get_focused():set_size({ h = 300 }) -- keep the window's width but make it 300 pixels tall
|
||||
---window.get_focused():set_size({}) -- do absolutely nothing useful
|
||||
---@tparam table size A table of the form { `w`: `integer?`, `h`: `integer?` }
|
||||
---@see WindowModule.set_size
|
||||
function window:set_size(size) end
|
||||
|
||||
---Move this window to a tag, removing all other ones.
|
||||
---
|
||||
---@usage
|
||||
--- -- With the focused window on tags 1, 2, 3, and 4...
|
||||
---window.get_focused():move_to_tag("5")
|
||||
--- -- ...will make the window only appear on tag 5.
|
||||
---@tparam string name
|
||||
---@tparam ?Output output
|
||||
---@see WindowModule.move_to_tag
|
||||
function window:move_to_tag(name, output) end
|
||||
|
||||
---Toggle the specified tag for this window.
|
||||
---
|
||||
---Note: toggling off all tags currently makes a window not response to layouting.
|
||||
---
|
||||
---@usage
|
||||
--- -- With the focused window only on tag 1...
|
||||
---window.get_focused():toggle_tag("2")
|
||||
--- -- ...will also make the window appear on tag 2.
|
||||
---@tparam string name
|
||||
---@tparam ?Output output
|
||||
---@see WindowModule.toggle_tag
|
||||
function window:toggle_tag(name, output) end
|
||||
|
||||
---Close this window.
|
||||
---
|
||||
---This only sends a close *event* to the window and is the same as just clicking the X button in the titlebar.
|
||||
---This will trigger save prompts in applications like GIMP.
|
||||
---
|
||||
---@usage
|
||||
---window.get_focused():close() -- close the currently focused window
|
||||
---@see WindowModule.close
|
||||
function window:close() end
|
||||
|
||||
---Get this window's size.
|
||||
---
|
||||
---@usage
|
||||
--- -- With a 4K monitor, given a focused fullscreen window...
|
||||
---local size = window.get_focused():size()
|
||||
--- -- ...should have size equal to `{ w = 3840, h = 2160 }`.
|
||||
---@treturn table|nil size The size of the window in the form { `w`: `integer`, `h`: `integer` }, or nil if it doesn't exist.
|
||||
---@see WindowModule.size
|
||||
function window:size() end
|
||||
|
||||
---Get this window's location in the global space.
|
||||
---
|
||||
---Think of your monitors as being laid out on a big sheet.
|
||||
---The top left of the sheet if you trim it down is (0, 0).
|
||||
---The location of this window is relative to that point.
|
||||
---
|
||||
---@usage
|
||||
--- -- With two 1080p monitors side by side and set up as such,
|
||||
--- -- if a window is fullscreen on the right one...
|
||||
---local loc = that_window:loc()
|
||||
--- -- ...should have loc equal to `{ x = 1920, y = 0 }`.
|
||||
---@treturn table|nil loc The location of the window in the form { `x`: `integer`, `y`: `integer` }, or nil if it's not on-screen or alive.
|
||||
---@see WindowModule.loc
|
||||
function window:loc() end
|
||||
|
||||
---Get this window's class. This is usually the name of the application.
|
||||
---
|
||||
---@usage
|
||||
--- -- With Alacritty focused...
|
||||
---print(window.get_focused():class())
|
||||
--- -- ...should print "Alacritty".
|
||||
---@treturn string|nil class This window's class, or nil if it doesn't exist.
|
||||
---@see WindowModule.class
|
||||
function window:class() end
|
||||
|
||||
---Get this window's title.
|
||||
---
|
||||
---@usage
|
||||
--- -- With Alacritty focused...
|
||||
---print(window.get_focused():title())
|
||||
--- -- ...should print the directory Alacritty is in or what it's running (what's in its title bar).
|
||||
---@treturn string|nil title This window's title, or nil if it doesn't exist.
|
||||
---@see WindowModule.title
|
||||
function window:title() end
|
||||
|
||||
---Toggle this window's floating status.
|
||||
---
|
||||
---When used on a floating window, this will change it to tiled, and vice versa.
|
||||
---
|
||||
---When used on a fullscreen or maximized window, this will still change its
|
||||
---underlying floating/tiled status.
|
||||
---@tparam Window win
|
||||
function window:toggle_floating(win) end
|
||||
|
||||
---Toggle this window's fullscreen status.
|
||||
---
|
||||
---When used on a fullscreen window, this will change the window back to
|
||||
---floating or tiled.
|
||||
---
|
||||
---When used on a non-fullscreen window, it becomes fullscreen.
|
||||
---@tparam Window win
|
||||
function window:toggle_fullscreen(win) end
|
||||
|
||||
---Toggle this window's maximized status.
|
||||
---
|
||||
---When used on a maximized window, this will change the window back to
|
||||
---floating or tiled.
|
||||
---
|
||||
---When used on a non-maximized window, it becomes maximized.
|
||||
---@tparam Window win
|
||||
function window:toggle_maximized(win) end
|
||||
|
||||
---Get whether or not this window is focused.
|
||||
---
|
||||
---@usage
|
||||
---print(window.get_focused():focused()) -- should print `true`.
|
||||
---@treturn boolean|nil floating `true` if it's focused, `false` if it's tiled, or nil if it doesn't exist.
|
||||
---@see WindowModule.focused
|
||||
function window:focused() end
|
||||
|
||||
---Get whether or not this window is floating (true) or tiled (false).
|
||||
---@treturn boolean|nil
|
||||
function window:floating() end
|
||||
|
||||
---Get whether or not this window is fullscreen.
|
||||
---@treturn boolean|nil
|
||||
function window:fullscreen() end
|
||||
|
||||
---Get whether or not this window is maximized.
|
||||
---@treturn boolean|nil
|
||||
function window:maximized() end
|
Loading…
Reference in a new issue