Find a file
Ottatop 4b1c4f53e1
Some checks are pending
CI (Pinnacle) / Build (push) Waiting to run
CI (Pinnacle) / Run tests (push) Waiting to run
CI (Pinnacle) / Check formatting (push) Waiting to run
CI (Pinnacle) / Clippy check (push) Waiting to run
Comment out test
it no worky sometimes on github CI
2024-08-15 12:50:27 -05:00
.github/workflows CI/doc/rust: Remove xkbcommon 2024-08-07 11:41:29 -05:00
api Change default keybinds 2024-08-07 11:37:54 -05:00
assets Add font attributions 2023-08-16 21:27:18 -05:00
pinnacle-api-defs Add tag active signal 2024-04-18 14:42:49 -05:00
resources Make icon transparent 2024-03-05 23:17:51 -06:00
snowcap@3dc265976a Update dependencies, api/lua: Fix log source 2024-07-16 14:53:52 -05:00
src Send frames on no damage 2024-08-15 12:38:34 -05:00
tests Comment out test 2024-08-15 12:50:27 -05:00
wlcs_pinnacle api/rust: Transition to statics for clients 2024-07-05 18:54:42 -05:00
.gitignore Add wlcs compilation script 2024-04-26 13:03:17 -05:00
.gitmodules Wait for Snowcap to start, rust-api: Fix signals 2024-06-14 14:47:05 -05:00
build.rs Bump dependencies 2024-08-05 18:37:05 -05:00
Cargo.lock Properly throttle rendering 2024-08-10 23:01:10 -05:00
Cargo.toml Properly throttle rendering 2024-08-10 23:01:10 -05:00
CHANGELOG.md Update CHANGELOG 2023-10-25 04:05:47 -05:00
CONTRIBUTING.md Update README and CONTRIBUTING 2023-08-28 21:11:30 -05:00
flake.lock nix: move xwayland into buildInputs 2024-04-13 15:00:53 -05:00
flake.nix README: update for Snowcap, kill Pinnacle if Snowcap dies 2024-06-16 18:51:34 -05:00
justfile api/lua: Make client connection explicit 2024-07-11 15:50:33 -05:00
LICENSE Relicense to GPL 3.0 2023-08-01 11:18:08 -05:00
README.md Change default keybinds 2024-08-07 11:37:54 -05:00
rustfmt.toml Update CI workflow 2024-01-29 21:56:58 -06:00
TODO.md Update Smithay 2024-07-01 17:01:53 -05:00

Pinnacle banner

Discord Matrix

image

Table of Contents

Info

What is Pinnacle?

Pinnacle is a Wayland compositor built in Rust using Smithay. It's my attempt at creating something like AwesomeWM for Wayland.

Pinnacle comes integrated with Snowcap, a very, very WIP widget system. Currently it's only being used for the builtin quit prompt and keybind overlay. In the future, Snowcap will be used for everything Awesome uses its widget system for: a taskbar, system tray, etc.

Features

  • Tag system
  • Customizable layouts, including most of the ones from Awesome
  • (Scuffed) XWayland support
  • wlr-layer-shell support
  • Configurable in Lua or Rust
  • wlr-screencopy support
  • A really really WIP widget system
  • Is very cool 👍

Roadmap

Dependencies

You will need:

  • Rust 1.76 or newer
  • The following external dependencies:
    • libwayland
    • libxkbcommon
    • libudev
    • libinput
    • libgbm
    • libseat
    • libEGL
    • libsystemd
    • libdisplay-info for monitor display information
    • xwayland for Xwayland support
    • protoc for the API

The following are optional dependencies:

  • just to automate installation of libraries and files

  • The following are required to use the Lua API:

    • just as mentioned above
    • lua 5.2 or newer
    • luarocks for API installation
      • You must run eval $(luarocks path --lua-version <your-lua-version>) so that your config can find the API library files. It is recommended to place this command in your shell's startup script.
  • Arch and derivatives:

    sudo pacman -S wayland libxkbcommon libinput mesa seatd systemd-libs libdisplay-info xorg-xwayland protobuf
    # And optionally
    sudo pacman -S just lua luarocks
    
  • Debian and derivatives:

    sudo apt install libwayland-dev libxkbcommon-dev libudev-dev libinput-dev libgbm-dev libseat-dev libsystemd-dev protobuf-compiler xwayland libegl-dev libdisplay-info-dev
    # And optionally
    sudo apt install just lua5.4 luarocks
    
    • Note: just is only available in apt from Debian 13.
  • Nix and NixOS:

    • Use the provided flake.nix with a devShell. It also includes the other tools needed for the build and sets up the LD_LIBRARY_PATH so the dynamically loaded libraries are found.

      Luarocks currently doesn't install the Lua library and its dependencies due to openssh directory shenanigans. Fix soon, hopefully. In the meantime you can use the Rust API.

TODO: other distros

Building

Clone this repository and, if building with Snowcap integration, update the snowcap submodule:

git clone https://github.com/pinnacle-comp/pinnacle
git submodule update --init

Note

For all following cargo/just commands, if you would like to build without Snowcap integration, run with --no-default-features.

Build the project with:

cargo build [--release]

To additionally install the default configs, protobuf definitions, and Lua API, run:

just install build [--release] # Order matters, put build/run/test last to pass through arguments

Running

Tip

Before running, read the information in Configuration.

Important

If you are going to use a Lua config, you must run just install to install the protobuf definitions and Lua library.

After building, run the executable located in either:

./target/debug/pinnacle     # without --release
./target/release/pinnacle   # with --release

Important

When compiling with Snowcap integration, if you do not have Vulkan set up properly, Pinnacle will crash on startup.

For those using Nix outside of NixOS, you will need to run the built binary with nixGL using both GL and Vulkan wrappers, nested inside one another:

nix run --impure github:nix-community/nixGL -- nix run --impure github:nix-community/nixGL#nixVulkanIntel -- ./target/debug/pinnacle

Or, run the project directly with

cargo run [--release]

# With installation:
just install run [--release]

See flags Pinnacle accepts by running cargo run -- --help (or -h).

Configuration

Pinnacle is configured in your choice of Lua or Rust.

Out-of-the-box configurations

Pinnacle embeds the default Rust config into the binary. If you would like to use the Lua or Rust default configs standalone, run one of the following in the crate root:

# For a Lua configuration
just install run -- -c ./api/lua/examples/default

# For a Rust configuration
cargo run -- -c ./api/rust/examples/default_config

When running a Rust config without compiled Snowcap integration, use the following directory instead (Lua users can use the same directory):

cargo run -- -c ./api/rust/examples/default_config_no_snowcap

Custom configuration

Important

Pinnacle is under development, and there will be major breaking changes to these APIs until I release version 0.1, at which point there will be an API stability spec in place.

Generating a config

Run the following command to open up the interactive config generator:

just install-configs run -- config gen

This will prompt you to choose a language (Lua or Rust) and directory to put the config in. It will then generate a config at that directory. If Lua is chosen and there are conflicting files in the directory, the generator will prompt to rename them to a backup before continuing. If Rust is chosen, the directory must be manually emptied to continue.

Note that this currently copies default configs with Snowcap integration.

Run cargo run -- config gen --help for information on the command.

More on configuration

Pinnacle is configured mostly at runtime through IPC using gRPC. This is done through configuration clients that use the Lua and Rust APIs.

As the compositor has no direct integration with these clients, it must know what it needs to run through a separate file, aptly called the metaconfig.toml file.

To start a config, Pinnacle will search for a metaconfig.toml file in the first directory that exists from the following:

  1. The directory passed in through --config-dir/-c
  2. $PINNACLE_CONFIG_DIR
  3. $XDG_CONFIG_HOME/pinnacle
  4. ~/.config/pinnacle if $XDG_CONFIG_HOME is not defined

If there is no metaconfig.toml file in that directory, Pinnacle will start the embedded Rust config.

Additionally, if your config crashes, Pinnacle will also start the embedded Rust config.

Note

If you are using a Lua config and have not run eval $(luarocks path --lua-version <your-lua-version>), Pinnacle will fallback to the embedded Rust config.

The metaconfig.toml file

A metaconfig.toml file must contain the following entries:

  • command: An array denoting the program and arguments Pinnacle will run to start a config.
  • reload_keybind: A table denoting a keybind that Pinnacle will hardcode to restart your config.
  • kill_keybind: A table denoting a keybind that Pinnacle will hardcode to quit the compositor.
    • The two keybinds above prevent you from getting locked in the compositor if the default config fails to start.

It also has the following optional entries:

  • socket_dir: A directory that Pinnacle will place its IPC socket in (this defaults to $XDG_RUNTIME_DIR, falling back to /tmp if that doesn't exist).
  • [envs]: A table of environment variables that Pinnacle will start the config with.

For the specifics, see the default metaconfig.toml file.

Lua Language Server completion

A .luarc.json file is included with the default Lua config and will set the correct workspace library files for use with the Lua language server.

API references

Lua: https://pinnacle-comp.github.io/lua-reference/.
Rust: https://pinnacle-comp.github.io/rust-reference/main.

Documentation for the Rust API can be reached by replacing main with the branch you want. Other branches for Lua soontm

Controls

The following are the default controls, mirroring Awesome's defaults.

Mod is Super when running in a tty and Alt when running as a nested window.

Binding Action
Mod + s Show the keybind overlay
Mod + Mouse left drag Move window
Mod + Mouse right drag Resize window
ModShift + q Quit Pinnacle
ModCtrl + r Reload the config
ModShift + c Close window
Mod + Return Spawn Alacritty (you can change this in the config)
ModCtrl + Space Toggle floating
Mod + f Toggle fullscreen
Mod + m Toggle maximized
Mod + Space Cycle to the next layout
ModShift + Space Cycle to the previous layout
Mod + 1 to 5 Switch to tag 1 to 5
ModCtrl + 1 to 5 Toggle tag 1 to 5
ModShift + 1 to 5 Move a window to tag 1 to 5
ModCtrlShift + 1 to 5 Toggle tag 1 to 5 on a window

Feature Requests, Bug Reports, Contributions, and Questions

See CONTRIBUTING.md.

Changelog

See CHANGELOG.md.

With Special Thanks To

  • Smithay: For being a great compositor library and also allowing me not to deal with all the graphics stuff I still don't understand
  • Niri: For all that rendering and protocol stuff I, ahem, took inspiration from