35919ac0fa
Implement wlr-foreign-toplevel-management |
||
---|---|---|
.github/workflows | ||
api | ||
assets | ||
pinnacle-api-defs | ||
resources | ||
src | ||
tests | ||
wlcs_pinnacle | ||
.gitignore | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
flake.lock | ||
flake.nix | ||
justfile | ||
LICENSE | ||
README.md | ||
rustfmt.toml | ||
TODO.md |
Table of Contents
- Info
- Dependencies
- Building
- Running
- Configuration
- Controls
- Feature Requests, Bug Reports, Contributions, and Questions
- Changelog
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.
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
- Is very cool 👍
Roadmap
- See #142
Dependencies
You will need:
- Rust 1.75 or newer
- Packages for Smithay:
libwayland libxkbcommon libudev libinput libgdm libseat
, as well asxwayland
- Arch:
sudo pacman -S wayland wayland-protocols libxkbcommon systemd-libs libinput mesa seatd xorg-xwayland
- Debian/Ubuntu:
sudo apt install libwayland-dev libxkbcommon-dev libudev-dev libinput-dev libgdm-dev libseat-dev xwayland
- NixOS: There is flake
flake.nix
with a devShell. It also includes the other tools needed for the build and sets up theLD_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.
- Arch:
- protoc, the Protocol Buffer Compiler, for configuration
- Arch:
sudo pacman -S protobuf
- Debian/Ubuntu:
sudo apt install protobuf-compiler
- Arch:
- just, to automate installation of libraries and files
- You don't need this but without installation you will not be able to run
cargo run -- config gen
or use the Lua API (it requires the protobuf definitions at runtime) - Arch:
sudo pacman -S just
- You don't need this but without installation you will not be able to run
If you would like to use the Lua API, you will additionally need:
- Lua 5.2 or newer
- LuaRocks, the Lua package manager
- Arch:
sudo pacman -S luarocks
- Debian/Ubuntu:
sudo apt install luarocks
- 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:
TODO: other distros
Building
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
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
cargo run -- -c "./api/lua/examples/default"
just install run -- -c "./api/lua/examples/default"
# For a Rust configuration
cargo run -- -c "./api/rust/examples/default_config"
just install run -- -c "./api/rust/examples/default_config"
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
Note
The default configs must be installed for them to be copied:
just install-configs # Or alternatively, `just install` which installs everything
Run the following command to open up the interactive config generator:
cargo 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.
Run cargo run -- config gen --help
for information on the command.
More on configuration
Pinnacle is configured purely through IPC using gRPC. This is done through configuration clients that use the Lua and Rust interface libraries.
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:
- The directory passed in through
--config-dir
/-c
$PINNACLE_CONFIG_DIR
$XDG_CONFIG_HOME/pinnacle
~/.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 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/main.
Rust: https://pinnacle-comp.github.io/rust-reference/main.
Documentation for other branches can be reached by replacing
main
with the branch you want.
Controls
The following are the default controls in the default_config
.
Binding | Action |
---|---|
Ctrl + Mouse left drag | Move window |
Ctrl + Mouse right drag | Resize window |
CtrlAlt + q | Quit Pinnacle |
CtrlAlt + c | Close window |
Ctrl + Return | Spawn Alacritty (you can change this in the config) |
CtrlAlt + Space | Toggle between floating and tiled |
Ctrl + f | Toggle fullscreen |
Ctrl + m | Toggle maximized |
Ctrl + Space | Cycle to the next layout |
CtrlShift + Space | Cycle to the previous layout |
Ctrl + 1 to 5 | Switch to tag 1 to 5 |
CtrlShift + 1 to 5 | Toggle tag 1 to 5 |
CtrlAlt + 1 to 5 | Move a window to tag 1 to 5 |
CtrlAltShift + 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
.