Tessera

A tiling Wayland compositor you craft in Lisp.

Tessera is a window manager for Linux, built on wlroots and written in Sigil, a Lisp derived from Scheme. A small C core draws your screen and speaks Wayland. Everything that decides how your windows behave (layouts, focus, keys, workspaces, the bar) is Sigil code you can read, change and reload without logging out.

Tessera in its Orpiment colors over the Facets wallpaper: the bar along the top and four windows in a two-by-two grid, Emacs editing Tessera's grid layout code, htop, a git log, and a terminal running a REPL that asks the running window manager about its own workspaces and windows. The focused REPL has a gold border, and the wallpaper shows faintly through the terminals.
A declared 2x2 grid on Facets, Tessera's default wallpaper. Bottom right is a REPL connected to the compositor that's drawing it.

Its behavior is yours to rewrite

Many window managers hand you a config file. You can change the numbers and the key bindings, but the behavior behind them is fixed unless you patch the compositor and rebuild it. Tessera draws the line in a different place.

The C side is only the part that has to be fast: Wayland protocols, rendering, the frame loop and buffer handling. It lives in sigil-wm, a library for writing window managers in Sigil, which comes with small stacking, tiling and tabbed managers of its own as examples. The decisions live in Tessera's Sigil code: where a new window goes, what a key does, which workspace shows on which monitor. Those are ordinary Sigil procedures, and you can read every one of them.

A REPL into your session

Tessera listens on a socket that only your user can open, and it speaks Lisp there, not JSON. Two commands talk to it. tessera eval EXPRESSION sends one Sigil expression to the running session and prints the answer, so a shell script, a bar module or a key binding can ask the session something or change it:

$ tessera eval '(focused-workspace)'
"1"

tessera repl is the same conversation at the keyboard: you type expressions and the session answers. You can ask it what it's doing, or hand it a new configuration, and ,h lists what you can call for commands, workspaces, windows and outputs. (help 'config), (help 'themes), (help 'layouts) and (help 'keys) list the rest. These are the questions from the screenshots and the answers Tessera gave:

(tessera user) > (workspace-layout "1")
grid
(tessera user) > (map window-app-id (workspace-tiled-windows "1"))
("emacs" "htop" "tmux" "repl")
(tessera user) > (metrics-inner-gap (config-metrics (current-config)))
6
(tessera user) > (apply-config!
              >   (config-with (current-config)
              >     metrics: (metrics inner-gap: 24 border: 3)))
#t
(tessera user) > (metrics-inner-gap (config-metrics (current-config)))
24

The new configuration takes over and your windows don't move: they keep their workspaces, their tab order and their floating positions. The README has the details.

Today the REPL can replace the configuration, look into the running state and act on it: focus a workspace, move a window or switch palettes. A command you define there with define-command shows up in the launcher, too. Where I'm taking it is further than that! Every decision Tessera makes should be a procedure you can redefine from the REPL the same way, so you can try a new placement rule or a different focus behavior on your real session and keep it if you like it.

A bar that's part of the program

Tessera has its own bar, the one along the top of every screenshot here. Out of the box it shows your workspaces, the current layout, a clock, the network, removable drives and whether the nightlight is on, with its current temperature. Each section is Sigil code too: a procedure that returns text, or a program whose output you point it at. The bar can stay on screen or show only while you hold the modifier, and it reloads with the rest of your configuration. If you'd rather keep waybar, one line turns the built-in bar off.

A launcher for your commands

Press Super+space and Tessera's own launcher opens: your applications, your open windows and the session's commands in one list, filtered as you type. Commands you write in your config with define-command sit right next to your applications, and a command can ask for an argument, with completions the running session fills in:

(define-command "rotate wallpaper" next-wallpaper!)

The launcher runs as its own process and never loads your config, so a crash in it can't take your session down. Underneath it is tessera select, a chooser that reads choices on standard input and prints the one you pick, so dmenu-style scripts can use it too. If you'd rather keep fuzzel, keep your key binding for it and Tessera stays out of the way.

A nightlight without another program

Tessera can warm your screens in the evening and bring them back in the morning on its own. Give it your location or a pair of times, and it calculates sunrise and sunset on your machine, with no location service or network involved. tessera nightlight shows what each screen is set to, and on, off and auto change it on the fly.

Themes

Tessera comes with five palettes. Orpiment is the house palette, the one in every screenshot here, and Lichen, Smalti, Verdigris and Workbench are the others. A palette colors the whole session: the bar, the launcher, the window borders and title bars, the wallpaper and the lock screen, and the programs you run alongside Tessera: foot, fuzzel, mako, tmux, Emacs, btop, and GTK and Qt applications. Plain GTK widgets, such as pavucontrol's, still keep their Adwaita look for now. Each palette also comes with two wallpapers drawn in its colors, Facets and Drift.

The five palettes Tessera ships, one row each: Orpiment, Lichen, Smalti, Verdigris and Workbench, with eight swatches per row for its panel, text, focus, second accent and status colors

The tessera theme command lists them and switches between them, and the running session changes color without a restart:

$ tessera theme list
$ tessera theme preview workbench   # try it
$ tessera theme revert              # go back
$ tessera theme apply workbench     # or keep it
$ tessera theme wallpaper drift     # switch wallpapers, same palette
$ tessera theme status

Applying a palette also writes a theme file for each of those programs. You include each file once in that program's own config (swaylock takes its file with -C), and from then on a running foot, tmux or mako changes color along with everything else. tessera theme status lists the generated files and tells you which includes are still missing. If you write your own Tessera config, start it from (stock-config-for (theme-palette)) instead of stock-config, so it follows whichever palette you apply.

In these screenshots, the borders, the bar, the terminals, tmux, fuzzel and mako all take their colors from Orpiment's generated files, with no hand-picked colors in any of their configs. Tessera draws its own launcher, lock screen and greeter straight from the palette. Emacs runs its own modus-vivendi theme in a terminal, with the terminal's translucent background showing through. The wallpapers come from small Sigil programs in Tessera's repository, so you can render your own variations of Facets and Drift.

Familiar if you're coming from Sway

The defaults are deliberately close to Sway's: the same gaps and borders, output settings that work the way Sway's do, and the tools you already use work alongside it: waybar, fuzzel, mako, swayidle, swaylock, kanshi, wlr-randr and grim. X11 programs run through XWayland under the same layout and focus rules as everything else.

What's coming

Here's what I'm working on next:

Install Tessera

Latest release: Tessera 0.5.1, . Release notes and the launch announcement.

Download Tessera for Linux (x86_64) Using Guix or Nix?

The download is tessera-0.5.1-linux-amd64, a single executable. The Sigil runtime and Tessera's own code are built into it, so you don't need Sigil installed or a copy of the source. Your system provides the graphics drivers, fonts and keyboard data, plus the four libraries the bar draws its text with: Fontconfig, FreeType, HarfBuzz and Cairo. The build manifest that comes with each release lists exactly which libraries and which glibc it needs.

Put it on your PATH:

install -Dm755 tessera-0.5.1-linux-amd64 ~/.local/bin/tessera
Check the download

The registry URL names the executable's SHA-256. Download and check it before you install it:

curl -fLo tessera-0.5.1-linux-amd64 https://pkg.usesigil.org/v1/cas/sha256/a0622bf167ecf23851c66f7bc0176ec0621ca236f9e417bbdabdd4232f052d81
echo "a0622bf167ecf23851c66f7bc0176ec0621ca236f9e417bbdabdd4232f052d81  tessera-0.5.1-linux-amd64" | sha256sum --check

The checksum tells you the download arrived intact, but not who published it.

You'll also want the programs Tessera calls on: foot is the default terminal, swaylock locks the screen, and grim and slurp take screenshots. Tessera draws your wallpaper itself; swaybg is only needed for wallpapers that aren't PNG or JPEG files. Tessera has its own launcher and notifications, so you don't need fuzzel or mako, but both still work if you like them.

Try it in a window first, from a terminal in the Wayland session you already use:

tessera start

That opens Tessera as a window inside the compositor you already use, which is the easiest way to get a feel for it without touching your login. Press Alt+Shift+Return for a terminal, and everything you start from it opens inside Tessera. Nested, the modifier is Alt, because your outer compositor keeps the Super chords for itself. Alt+t switches between tabs and a grid, and Alt+Shift+x quits.

When you're ready to run it as your real session, switch to an unused TTY, log in and run exec tessera, the way you'd start Sway. On a TTY, plain tessera starts your session; inside a desktop it lists its commands instead, and tessera start is the one that opens a window. To start it whenever you log in there, use exec tessera in your shell profile. Keep a spare TTY available the first few times. The README covers that, the default keys, the configuration file and what to do if something goes wrong.

Would you rather build it yourself? The README has the source build, which uses GNU Guix to pin the whole environment to the versions Tessera was tested with.

Where it stands

Tessera is still early in development, but it already runs on real hardware as a full login session, the way Sway does. I use it as my main compositor! It also runs nested inside another compositor, and nearly all of its test suite starts real Wayland and X11 programs and checks the pixels they put on screen. What it hasn't had yet is many machines, so if you try it as your session, keep a spare TTY handy the first few times.

A few things to know before you try it: