Geen omschrijving

Johannes Zellner cde8d79d2a Initial commit 1 maand geleden
data cde8d79d2a Initial commit 1 maand geleden
resources cde8d79d2a Initial commit 1 maand geleden
src cde8d79d2a Initial commit 1 maand geleden
.gitignore cde8d79d2a Initial commit 1 maand geleden
Cargo.lock cde8d79d2a Initial commit 1 maand geleden
Cargo.toml cde8d79d2a Initial commit 1 maand geleden
LICENSE cde8d79d2a Initial commit 1 maand geleden
LICENSE-Smithay.txt cde8d79d2a Initial commit 1 maand geleden
Makefile cde8d79d2a Initial commit 1 maand geleden
README.md cde8d79d2a Initial commit 1 maand geleden
config.example.toml cde8d79d2a Initial commit 1 maand geleden

README.md

Compositron

A small Wayland compositor with a fullscreen, searchable application overview.

Compositron is built on Smithay and draws its overview directly in the compositor (tiny-skia and cosmic-text), so the launcher is not a separate Wayland client.

Features

  • Six fixed virtual desktops.
  • Fullscreen application overview with live filtering.
  • Application catalog from XDG .desktop files (including Flatpak exports).
  • Icon theme lookup, SVG/PNG rasterization, and generated fallback icons.
  • Click or press Enter to launch an application.
  • Floating windows with client- or server-side decorations.
  • Move and resize windows by dragging title bars and edges.
  • Focus, raise, maximize, fullscreen, close, and simple window cycling.
  • Layer-shell support for bars, notification daemons, and wallpaper clients.
  • Clipboard, drag and drop, xdg-activation, fractional scale, and popups.
  • Nested --winit backend for development inside an existing Wayland session.
  • DRM/libseat/libinput backend for a real session.
  • HiDPI-aware UI: automatic scale detection in the nested backend, and configurable output_scale for DRM outputs.

Requirements

A Wayland-capable Linux system with EGL/GBM, libinput, libseat, and Mesa. On Arch Linux:

sudo pacman -S --needed base-devel rust pkgconf wayland mesa libinput libseat gbm
make build

Running

Development, nested in your current GNOME/Wayland session:

make run

This opens Compositron in a normal window and does not take over the seat or display. The nested window needs keyboard focus. If it appears on the screen but the first frame is missing, click inside it once; this is a winit/nested-backend quirk.

GNOME consumes Super and Alt+Tab, so they do not reach a nested compositor. Compositron opens with the overview visible in --winit mode; after closing it, use Ctrl+Alt+Space or Ctrl+Alt+O to reopen it. GNOME-safe window shortcuts are Ctrl+Shift+Left/Right (snap), Ctrl+Shift+Up/Down (maximize/restore), Ctrl+Shift+1…6 (workspace), and Ctrl+Shift+Alt+1…6 (move window to workspace). Mouse dragging and resizing also work normally.

Real session from a TTY:

dbus-run-session -- ./target/release/compositron

Or install it as a session so GDM/SDDM can start it:

make build
sudo make install

This installs /usr/local/bin/compositron and /usr/share/wayland-sessions/compositron.desktop. Then log out and choose Compositron in the display manager.

A wallpaper or bar can be provided by any layer-shell client, for example:

swaybg -c '#1b2430'

Keybindings

Shortcut Action
Super (tap) or Super+Space Toggle the application overview
Ctrl+Alt+Space / Ctrl+Alt+O Toggle the overview (nested-mode fallback)
Type / Backspace / Left / Right Filter and edit the search query
Up / Down / Page Up / Page Down Move through the app grid
Enter Launch the selected app
Escape Close the overview
Wheel Scroll the app grid
Super+1 … Super+6 Switch to workspace 1–6
Super+Shift+1 … Super+Shift+6 Move the focused window to that workspace
Super+Page Up / Page Down Previous / next workspace
Super+Left / Right Snap the focused window to the left/right half
Super+Up Maximize the focused window
Super+Down Restore from maximize/fullscreen
Super+F Toggle fullscreen
Super+Q Close the focused window
Super+Return Open the configured terminal
Alt+Tab / Alt+Shift+Tab Cycle windows
Ctrl+Alt+Left/Right/Up/Down Alternative snap/maximize/restore shortcuts
Ctrl+Shift+Left/Right GNOME-safe snap shortcuts
Ctrl+Shift+Up/Down GNOME-safe maximize/restore shortcuts
Ctrl+Shift+1 … 6 GNOME-safe workspace shortcuts
Ctrl+Shift+Alt+1 … 6 GNOME-safe move-window-to-workspace shortcuts
Ctrl+Alt+F Alternative fullscreen shortcut
Ctrl+Alt+1 … 6 Alternative workspace shortcuts
Ctrl+Alt+Shift+1 … 6 Alternative move-window-to-workspace shortcuts
Ctrl+Alt+W Alternative close-window shortcut
Ctrl+Alt+Return Alternative terminal shortcut
Ctrl+Alt+Backspace, Super+Shift+Q Quit the compositor

A Super tap is detected on release and does not require holding Super. The Ctrl+Alt alternatives exist for environments where Super is grabbed by another compositor during nested development.

Configuration

Compositron reads ~/.config/compositron/config.toml (or $XDG_CONFIG_HOME/compositron/config.toml). All keys are optional:

terminal = "kgx"
icon_theme = "Adwaita"
font = "Cantarell"
output_scale = 2.0

output_scale applies to the DRM backend; the nested --winit backend uses the scale factor reported by GNOME automatically. Scaling is implemented at both the output/UI level and through the fractional-scale protocol for apps.

See config.example.toml. If no terminal is configured, Compositron tries foot, alacritty, kgx, kitty, gnome-terminal, xterm, then weston-terminal. A terminal must support executing a command for launcher entries with Terminal=true.

How the overview works

  • .desktop files are rescanned every time the overview opens.
  • Visibility follows NoDisplay, Hidden, TryExec, OnlyShowIn, and NotShowIn. Duplicate visible names are kept only once.
  • Exec field codes are expanded; gio launch is used as a fallback for D-Bus-activatable entries.
  • Icons are resolved through the configured freedesktop icon theme with a fallback to hicolor, then rasterized and cached in memory.
  • The overview is rendered into a fullscreen premultiplied ARGB buffer and composited above windows but below the cursor.

Current limitations

  • Single output. Hotplug of additional outputs is not supported yet.
  • No XWayland, so X11-only applications will not run.
  • No overview animations or window-preview thumbnails.
  • No lock screen, idle/DPMS management, screenshots, or portal integration.
  • No IME or accessibility support in the search field.
  • Keyboard shortcuts are fixed in this version.
  • The DRM/udev backend must be tested by logging into a real session; the nested --winit backend is the supported development path.

Project layout

src/
  apps.rs            XDG desktop-entry catalog, filtering, launching
  config.rs          Optional TOML configuration
  icons.rs           Icon theme lookup and rasterization
  text.rs            cosmic-text rendering into tiny-skia pixmaps
  overview/          Overview layout, rendering, input state
  workspaces.rs      Six spaces and output mapping
  shell/             xdg-shell, layer-shell, decorations, grabs
  render.rs          Output element composition
  input_handler.rs   Seat input, shortcuts, overview routing
  state.rs           Global compositor state and protocol handlers
  winit.rs, udev.rs  Backends

Credits

The compositor skeleton is adapted from Smithay's MIT-licensed anvil reference compositor. See LICENSE-Smithay.txt. Compositron itself is MIT licensed; see LICENSE.