Skip to content

Class pinnacle

The entry point to configuration.

This module contains the setup function, which is where you'll put all of your config in. It also contains general compositor actions like quit and reload_config.

Functions

function quit

function pinnacle.quit()

Quits Pinnacle.

function reload_config

function pinnacle.reload_config()

Reloads the active config.

function backend

function pinnacle.backend()
    -> "tty" | "window"

Gets the currently running backend.

Returns

  1. "tty" | "window" - "tty" if Pinnacle is running in a tty, or "window" if it's running in a nested window

function set_xwayland_self_scaling

function pinnacle.set_xwayland_self_scaling(should_self_scale: boolean)

Sets whether or not xwayland clients should scale themselves.

If true, xwayland clients will be told they are on an output with a larger or smaller size than normal then rescaled to replicate being on an output with a scale of 1.

Xwayland clients that support DPI scaling will scale properly, leading to crisp and correct scaling with fractional output scales. Those that don't, like xterm, will render as if they are on outputs with scale 1, and their scale will be slightly incorrect on outputs with fractional scale.

Results may vary if you have multiple outputs with different scales.

Parameters

should_self_scale: boolean

function init

function pinnacle.init()

Initializes the protobuf backend and connects to Pinnacle's gRPC socket.

If the Snowcap Lua API is installed and Snowcap is running, this will also setup Snowcap and connect to its socket as well.

function setup

function pinnacle.setup(config_fn: fun())

Sets up a Pinnacle config.

This receives a function that contains your config.

If you want to run a function with the config without blocking, see Pinnacle.run.

Parameters

config_fn: fun()

See also

function run

function pinnacle.run(run_fn: fun())

Runs a function with the Pinnacle API.

If you are writing a config, use Pinnacle.setup instead.

This receives a function that runs anything in this API. However, it will not block to receive compositor events.

Parameters

run_fn: fun()