Configuration and keybindings
On this page
- Configuration
- The pointer
- The magnifier
- A screen reader
- The keyboard
- A picture or a film as the wallpaper
- A terminal as the wallpaper
- Dark mode
- Screen sharing and remote control
- Gaps
- Window borders
- Motion
- A window that stops responding
- Window opacity
- Bar widgets
- Overriding the whole bar
- Interacting with the bar
- The clock, and the calendar under it
- Reloading the shell while it runs
- Media keys
- Notification sounds
- The system tray
- The notification centre
- The clipboard history
- Wi-Fi and Bluetooth
- The on-screen keyboard
- Layer-surface rules
- Window rules
- Groups
- Layout models
- Dynamic tiling arrangements
- Focus at the edge of a monitor
- Pixel format
- Graphics cards
- Outputs
- X11 applications on a HiDPI screen
Configuration
Three tiers, because a settings UI cannot run on a display that is not working yet — and because a settings UI whose every change is forgotten at the next restart is not one either.
Bootstrap — ~/.config/viewport/config.json (or --config PATH), read before any web content loads. This tier must stay in the compositor. The shell is fetched over the network; if it 404s, throws, or hangs, anything it owned dies with it. A keybinding defined here still works in that state, which is the difference between a broken desktop UI and a machine you cannot quit without switching to a TTY.
{
"url": "http://localhost:3000",
"url_span": true, // that page on every monitor; see below
"shell_backend": "wpe", // or "webkitgtk"; see docs/shell-backends.md
"timeout_ms": 5000,
"layout": "tiling", // built-in, or a layout_extensions name
"layout_extensions": {
"monocle": "/home/me/.config/viewport/monocle.js"
},
"widget_extensions": {
"world-clock": "/home/me/.config/viewport/world-clock.js"
},
"workspaces": {
"1": { "output": "eDP-1", "layout": "tiling",
"tiling_mode": "master-stack" },
"2": { "output": "DP-1", "layout": "scrolling",
"gaps": { "inner": 12, "smart": true } }
},
"adaptive_sync": false, // variable refresh rate, if the monitor will
"pixel_format": "auto", // or "10" / "8" bits per channel; see below
"gpu": "card1", // which card renders; see below
"cross_gpu": "native", // or "portable", with two cards; see below
"idle": { "lock_after": 600, "lock_delay": 10,
"lock_command": "swaylock -f", "blank_after": 900 },
"lid": "lock", // or "blank" / "suspend" / "ignore"; see below
"cursor": { "theme": "Bibata-Modern-Classic", "size": 24,
"hide_after_ms": 3000 }, // see below; absent is never
"magnify": { "step": 0.5, "max": 8.0 }, // the screen magnifier; see below
"wallpaper": "~/Pictures/wall.png", // the desktop background; see below
"wallpaper_mode": "fill", // or "fit" / "stretch" / "center" / "tile"
"terminal": "rio",
"menu": "wmenu-run -i", // an external menu; absent is the built-in launcher
"binds": {
"Mod4+Return": "exec rio",
"Mod4+d": "exec wmenu-run -i",
"Mod4+Shift+q": "close",
"Mod4+Shift+e": "exit",
"Mod4+Shift+c": "reload"
}
}workspaces is an optional object whose keys are positive workspace numbers. Each value accepts output, layout, tiling_mode, gaps, persistent, default_name, on_created_empty, no_border, no_rounding, decorate, float_gaps, animation and layout_opts. output is the connector preferred as that workspace's home; layout accepts a built-in or validated layout_extensions name; tiling_mode accepts manual, master-stack, spiral, bsp or grid; and gaps has the same optional inner, outer and smart fields as the global block. Omitted fields inherit global values. Invalid workspace numbers, unknown layout/mode names and negative gap sizes are rejected or ignored with a diagnostic before reaching the shell.
{
"workspaces": {
"3": { "output": "DP-1", "layout": "scrolling",
"persistent": true, "default_name": "code" },
"9": { "on_created_empty": "rio" }
}
}persistent keeps a workspace even when it is empty, so a bar watching it does not lose it. default_name is the name a workspace takes the first time it is created, unless the session file or a command has already named it. on_created_empty is a command the shell runs when the workspace is first switched to, which is when it comes into being — not when the config is loaded, so a rule for a workspace nobody visits starts nothing.
no_border and no_rounding (Hyprland's workspace rules of the same names) override the global border and radius for the windows on that workspace. no_border: true drops the coloured frame — the focus ring stays, so a borderless window still shows where the keyboard is. no_rounding: true draws the windows square, and the compositor is told to stop cropping the client to a rounded corner too, so the surface and its frame agree. Absent or false inherits the global border block.
decorate is Hyprland's rule of the same name: the umbrella over the border, the shadow and the groupbar, which this shell draws as the frame around a window. decorate: false draws the windows bare while rounding stays its own rule, so {"decorate": false, "no_rounding": false} is a borderless window with rounded corners. Absent or true leaves each of the others to its own setting.
float_gaps is the space between a floating window and the edges of the area reserved for windows — Hyprland's per-workspace rule, with the css_gaps shorthand: one number for every side, [vertical, horizontal], [top, horizontal, bottom], or [top, right, bottom, left]. It moves where a dialog is centred and how far a dragged floating window may go, without moving the tiled windows on the workspace. Absent means no inset.
{
"workspaces": {
"4": { "decorate": false, "no_rounding": false },
"7": { "float_gaps": [20, 40] }
}
}animation is Hyprland's per-workspace animation rule: the style a switch to this workspace runs, by name, from the ones the motion block's workspaces leaf accepts — fade, slide and slidefade. It wins over the leaf's own style for this workspace only, so one workspace can slide while the rest fade. An unknown name is dropped with a diagnostic and the leaf's style stands.
layout_opts is the layout's own vocabulary for this workspace — Hyprland's per-workspace layout_opts, which are options for a layout, not for the compositor. It is a map of strings, carried to the shell and handed to the workspace's layout as context.opts, so a layout_extensions script (or a built-in layout that grows a per-workspace knob) is configured per workspace:
{
"workspaces": {
"8": { "layout": "monocle", "animation": "slidefade",
"layout_opts": { "columns": "3" } }
}
}The built-in layouts accept no options of their own yet; the map exists for the extension hook. docs/layout-extension.md documents the context a layout receives.
Workspace assignment and layout policy remain shell-owned. Workspaces 1 through 9 exist initially and keep their default bindings; a command, rule or config entry naming a larger positive number creates it lazily. The shipped shell keeps at most 512 workspaces. shell layout.model and shell layout.mode change the active workspace rather than a session-wide global; those mutable choices and each workspace's last output home are saved in existing session.json. Names and empty dynamically created workspaces are saved there too. Config rules remain defaults, so restored mutable state wins for that session.
reload re-reads the config file and reloads the shell, so a changed keybinding takes effect without a restart. Only keys the file actually contains are applied, which means a key present in the file wins over the equivalent command-line flag on reload — the file is what you just edited. Startup-only settings (shell URL, backend, socket path) are re-read but do nothing until restart.
Actions are exec COMMAND, close, exit, reload, focus DIRECTION, mode NAME, appearance toggle, lock, blank, lock+blank, game-mode, background, volume STEP, volume mute, volume mic-mute, brightness STEP and shell COMMAND ARGS…. Typed volume and brightness actions read the resulting level back and show the OSD; an equivalent exec changes the device but cannot provide that feedback. background is the wallpaper terminal's only way in — see below.
env sets environment variables for the session and everything it starts:
"env": { "MOZ_ENABLE_WAYLAND": "1", "QT_QPA_PLATFORM": "wayland" }They are set before any backend opens, so the compositor itself sees them, and handed explicitly to every program the session launches — a binding's exec, the terminal, the menu, a locker — so a value changed on reload reaches the next program started. The gpu, pixel_format and cross_gpu keys and their command-line flags win for the variables they own, because those validate and a typo there should be a message rather than a session on the wrong card.
Runtime — the control socket. config.gaps, config.border, config.wallpaper, config.dark_mode, config.game_mode, config.cursor, config.motion, config.group, config.clock, config.bar, config.bar_blur, config.bar_widgets, config.bar_items, config.logo, config.tutorial, config.tiling_mode, config.layout, config.layout_extensions, config.focus_crosses_outputs, config.osk, config.tray, config.clipboard_history, config.icon_theme, config.theme, config.rules, config.layer_rules, config.decorations, config.workspaces, config.opacity, config.idle, config.lid, config.keyboard, config.input, config.notifications, config.magnify and output.configure change the compositor's copy of the configuration and re-announce it, without touching any file. That is the tier a wallpaper cycler runs on, and the tier the settings panel runs on: a value applies the moment it is set and is gone at the next restart, which is exactly what "let me try this" means. docs/ipc.md has the shape of each message; which keys still lack a setter is tracked in docs/roadmap.md — the aim is every setting, and the ones that do not have one yet are listed there by name.
Saved — ~/.config/viewport/settings.json, beside the bootstrap file and written only by config.save. It holds whatever the runtime tier was last asked for, and it is applied over the bootstrap file at every start and every reload. This is what makes a change from the settings panel stick.
The bootstrap file is never rewritten, deliberately. It is hand-written JSONC — comments, blank lines, keys grouped the way you think about them — and no round trip through a JSON parser keeps any of that; losing your own notes about your own desktop as a side effect of dragging a slider is not a trade a settings panel gets to make on your behalf. It is also the file the compositor needs in order to start on a broken display, which is the whole argument for the bootstrap tier, and so the last file that should be rewritten by the part of the desktop most likely to be wrong. Two files, one machine-owned, is the price of that.
Which means the overlay wins over the file you edited — which is the right way round for a panel, because the last thing you did in the UI is what you meant. When it is not what you meant, settings.json is small, it holds only the keys that were set, and deleting it (or one line out of it) puts the config file back in charge. The command line still beats both: a flag is the most deliberate thing there is.
The settings panel
Mod4+Shift+comma opens it. It covers dark mode, the wallpaper and its fitting, the gaps, the window border, and each monitor's mode, scale and rotation. Multiple monitors can be arranged horizontally or vertically in their published order. Every control sends the runtime setter for what it changes, so the desktop is already that shape while you are looking at it; Save sends config.save and writes the lot into settings.json.
Where a display reports sane physical dimensions, the panel recommends a scale from its current mode and pixel density. It rejects missing or implausible EDID dimensions, rounds to quarter steps, and clamps the answer to the same 1-2 range as the manual scale buttons. The recommendation is an explicit button, not an automatic change.
A display change raises a Keep-or-Revert bar, because the compositor puts the monitors back after twelve seconds unless something says the screen came back — see ipc.md. Doing nothing is the same as Revert, which is the point.
What the panel does not do: arbitrary monitor placement, turn one off, mirror one, or edit keybindings, window rules or bar widgets. Those are the config file's, and two of them are the config file's for a reason — output.configure can turn a screen off and the shell is never told a disabled output exists, so a panel offering the switch could not offer the way back.
The panel is data/shell/settings.js; a custom shell is free not to have one, and everything it sends is on the socket for viewport msg to send instead. Neither deadline fires while something is holding the screen awake, and holding it is not only Wayland's idle-inhibit: org.freedesktop.ScreenSaver and the inhibit portal are answered too, which between them is what a browser playing video, a video player and a presentation actually use. Nothing to configure — see Idle for what a hold is and when it ends.
lock locks the session the same way the idle timer would, so there is one place to configure what locking means; blank turns the outputs off until the next input, exactly as the idle timer does. lock+blank is both at once: the session locks and the outputs go off, and stay off until input wakes them to the lock screen — the idle lock's behaviour, asked for by hand, and the default Mod4+Shift+b. lid is what the laptop hinge does: "lock", "blank", "suspend" (via logind) or "ignore". Absent is lock when idle.lock_command is set, otherwise blank. A desktop has no lid, so the setting never fires.
At runtime. config.idle and config.lid on the control socket set the block and the hinge policy without touching the file:
viewport msg -t config.idle --lock_after 600 --lock_command swaylock
viewport msg -t config.lid --action lockChanging a deadline re-arms the timers, so a desk that has been quiet for an hour gets a full new period rather than locking on the next tick, and nothing is woken — a blanked desk stays blanked. An unknown lid action is refused whole rather than ignored. A reload that names no lid leaves the runtime policy alone the same way: it is the next start that drops back to what the file says, not the next edit.
idle.lock_delay is how long the outputs stand black after any lock is asked for, before it actually locks — seconds, opt-in only: absent or zero locks immediately, as before. During the black phase the session is still unlocked, and any deliberate input (a press, a motion) cancels the lock and brings the outputs back rather than letting it fire; the release of the chord that asked for the lock does not cancel it. Every way of asking — idle deadline, lock binding, lock+blank binding, lid, session.lock — goes through the same delay, so there is one answer to whether the desk is about to lock.
When the delay ends, a lock that asked for the screen (the lock binding, the lid, session.lock) turns the outputs back on to show the lock screen. A lock that asked for the dark — the idle deadline, or the lock+blank binding — leaves them blanked: the desk went dark and should not flash bright with the locker, so the session locks while the screen stays off and the lock screen appears only when input wakes it. The renderer fails closed to black until the lock screen has drawn, so waking never reveals the desktop.
A suspend locks the session too, whatever asked for it — the power menu, the lid, a systemctl suspend in a terminal. The compositor holds logind's sleep delay inhibitor and listens for PrepareForSleep: on the way down it locks first and only then lets the machine sleep, so a resume lands on the lock screen rather than on the desktop. This lock skips lock_delay — the delay is a black window that input cancels, and a machine that slept inside it would resume with the cancel still armed. It follows the same policy as the idle deadline: with lock_after zero or absent (the deck's setting) a suspend does not lock, and nothing here is configurable on its own.
idle.dim_after and idle.dim_floor ramp the panel brightness down across the idle window instead of holding full brightness until the blank. From dim_after seconds of inactivity the brightness falls linearly from full to dim_floor (a 0..1 multiplier, absent is 0) by blank_after — or, with no blank set, over the minute following dim_after — and holds at the floor until the blank. It is applied through the compositor's gamma ramp, so it scales whatever curve the output is already wearing: a dimmed desk keeps its colour profile and any night-light tint. Any deliberate input brightens it again at once, as does a SimulateUserActivity on the bus. An OLED panel ages by exposure, so a desk left bright for the whole idle window is exposure nobody asked for; this spends that window at falling drive. Omit dim_after for no dim. Both keys ride config.idle at runtime like the deadlines:
viewport msg -t config.idle --dim_after 300 --dim_floor 0.0What locking means is one setting, idle.lock_command, and it has two answers. Set, it is the program to run — swaylock -f, or anything else that speaks ext-session-lock-v1 — and the compositor's part is being a correct server for it, exactly as before. Unset, which is the default, the shell draws the lock screen itself: a clock on every monitor, a password box on the one you are looking at, and a button that raises the on-screen keyboard, so a machine with a touch screen and no keyboard can get back in. That last part is why it exists — a locker in another process cannot reach data/shell/osk.js, so a touch-only desk could lock and then had no way to type a password at all. Setting the key back to a command is the way out of the built-in screen, and the empty string is not a command: "lock_command": "" reads as "no locker", so it means the built-in screen rather than a shell started to run nothing.
lock_transparent draws the built-in lock screen as a translucent scrim over the wallpaper instead of an opaque cover, so the desk shows through it while locked. It is only safe because the shell hides the desktop furniture while locked — the windows, the bar and taskbar with every window's title, the notifications and any open picker — leaving only the wallpaper, which is not sensitive, under the scrim. The compositor still draws the shell's buffer and nothing else; hiding the furniture is what makes that buffer safe to show through. The scrim strength is tunable through the theme (--lock-scrim, a colour; the default is rgba(0, 0, 0, 0.55)). Absent is off — the opaque cover that fails closed. It only applies to the built-in screen, so it does nothing while idle.lock_command names an external locker.
The password is checked with PAM, on a thread of its own so a slow or unreachable authentication stack cannot stall the desk. The service is viewport where /etc/pam.d/viewport exists and login otherwise, and $VIEWPORT_PAM_SERVICE overrides both; login is the fallback rather than the service's own name because an unknown service falls through to /etc/pam.d/other, which either denies everything or permits everything depending on how the machine was set up, and neither is a thing to leave to chance. Nothing has to be installed for this to work — the compositor loads libpam at the first password rather than linking it, so a build on a machine without PAM headers still runs — but a machine with no libpam at all is a lock screen that refuses every password. It still locks: a session that declined to lock because it could not check a password would be a laptop going into a bag with the desktop on screen. The lock screen says so, the log says so, and the ways out are another VT or an idle.lock_command.
The lock screen fails closed, and this is the part worth knowing before relying on it. The shell is a web page, and a page can crash, hang or be reloaded while it is holding the lock. When any of that happens the session stays locked and the screen goes black — the compositor draws no part of the page's buffer on a locked screen until the page has said it painted a lock screen for that particular lock and painted a frame after saying so. A black screen that eats every key is an unhelpful failure; the desktop reappearing because the shell died would be a way past the lock, and that is the one this refuses to have. Chords use sway's spelling — Mod4/Super/Logo, Shift, Ctrl, Alt — and any key xkb_keysym_from_name accepts, including XF86AudioRaiseVolume. Caps and num lock are masked out of matching. Bindings outrank both the focused client and the shell, and fire on press only.
A chord's key may be a mouse button instead: Mod4+Mouse4=shell workspace.next and Mod4+Mouse5=shell workspace.prev are the usual thumb-button gestures (the shell defines those commands, so name your own in handleShellCommand()). Buttons are named Mouse1–Mouse5, BTN_LEFT/BTN_RIGHT/BTN_MIDDLE/ BTN_SIDE/BTN_EXTRA, or XButton1/XButton2. A button binding fires on the press while the modifier is held, and consumes the click — it is not passed on to the window under the pointer.
A name the keymap knows is always the key: Mod4+Left is the arrow key, not the left button. Write Mod4+Mouse1 or Mod4+BTN_LEFT for the button. This matters because a button binding consumes the press — Mod4+Left read as a button swallows every Mod4-held click, which is all of them on a bar: auto that is only on screen while Mod4 is down.
The scroll wheel binds the same way: Mod4+WheelUp=exec … and Mod4+WheelDown=… (also ScrollUp/ScrollDown). A wheel binding fires once per notch of a physical wheel while the modifier is held and consumes the scroll; a touchpad's two-finger scroll is never bound — it keeps scrolling whatever is under the pointer.
The locked modifier makes a binding fire while the session is locked:
"binds": {
"locked+XF86AudioRaiseVolume": "volume 5",
"locked+XF86AudioLowerVolume": "volume -5",
"locked+XF86AudioMute": "volume mute"
}Without locked, every binding is forwarded to the lock screen instead — the key goes to the password field, not to an action. A media-key row is the typical use: music controls and volume on the lock screen, while a chord that opens a terminal stays blocked. locked may appear anywhere in the modifier chain: locked+Mod4+q and Mod4+locked+q are the same binding. A locked binding and a non-locked binding on the same chord do not shadow each other: one fires while locked, the other while unlocked.
Ten more flags are written the same way, anywhere before the key:
release+fires on the key coming up rather than going down — Hyprland'sbindr. The two halves do not shadow each other, so the same chord can do one thing on press and another on release.non_consuming+(also spelledtransparent+) runs the action and still lets the key through to the focused client or the shell — Hyprland'sbindn/bindt. The same for a mouse button or a wheel notch.auto_consuming+is the conditional between consuming andnon_consuming+— Hyprland'sauto_consuming. The key is consumed when the dispatcher has something to act on, and given back to the client when it does not: acloseorfocuswith no focused window reaches the application instead of being swallowed by a no-op. Whether the action can act is read from the state when the chord matches, because the action itself runs after the keyboard filter returns.ignore_mods+matches whatever modifiers are held, named or not — Hyprland'sbindi.ignore_mods+q=closefires on plainq, onShift+qand onMod4+qalike, which is what makes it different from leaving the modifiers off the chord.repeating+(also spelledrepeat+) fires once on the press and then again at the keyboard's own repeat delay and rate for as long as the key is held. For a step that should keep stepping — volume, brightness — rather than an action that opens something.long_press+fires only once the key has been held half a second. A tap does nothing, which is what lets one chord carry two meanings; the key is kept from the client for the whole hold, so the two never both see it.universal+(also spelledsubmap_universal+) matches in every binding mode, not only the one it is written in — Hyprland'ssubmap_universal. A mode is otherwise a second keymap; this is the one chord that means the same thing everywhere.click+anddrag+are for a mouse button, and fire on the release rather than the press:click+only if the pointer moved at mostdrag_thresholdlogical pixels,drag+only if it moved further. Hyprland'sbindcand a buttonbindm. The threshold is a top-level key, absent 5.dont_inhibit+fires even while a client holds an inhibitor. A client holdingidle-inhibitgets every key except a VT switch; this is the escape hatch for the keys that must work under a fullscreen film or game.allow_input_capture+fires even while input is captured by a client. The compositor's own release chord aside, a captured desk hands everything to the capturing session; this is the chord that still belongs to it.device:NAME+restricts the binding to named input devices — Hyprland's per-devicedevice.device:!NAME+is the exclusion: every device but the named ones. Several prefixes accumulate a list, and the name is the libinput device name, matched verbatim (case and spaces kept). Absent matches every device. The device is the one the key or button arrives from; injected input has no physical device, so adevice:binding does not match it.
"binds": {
"release+Mod4+Shift+t": "shell push-to-talk.stop",
"non_consuming+Mod4+Mouse1": "shell bar.tap",
"auto_consuming+Mod4+q": "close",
"ignore_mods+q": "close",
"repeating+XF86AudioRaiseVolume": "volume 5",
"long_press+Mod4+Return": "shell launcher",
"universal+XF86AudioMute": "volume mute",
"click+Mod4+Mouse4": "shell workspace.next",
"device:!Gaming Keyboard+Mod4+Return": "shell launcher"
}Touchpad swipes and pinches may run the same actions as keybindings through the top-level gestures object:
"gestures": {
"swipe:3:left": "shell workspace.next",
"swipe:3:right": "shell workspace.prev",
"pinch:2:out": "magnify in",
"pinch:2:in": "magnify out"
}A swipe fires when its dominant axis reaches 120 libinput units. A pinch-out fires at scale 1.2 and pinch-in at 0.8. A cancelled or sub-threshold gesture does nothing. Configuring any direction for a gesture type and finger count captures that whole sequence from its beginning, so a client never receives a partial gesture. With no matching configuration, the complete gesture is forwarded through pointer-gestures-v1 as before. Desktop gesture actions are disabled while locked.
The reference shell also claims live gestures only while a layout uses them: three-finger swipes move the scrolling strip one screen pixel per gesture pixel, and two-finger pinches zoom the canvas continuously. A configured gesture of the same type and finger count wins over that live claim. Every other sequence continues to the focused client unchanged.
The top-level input object configures concrete libinput devices. * applies first; a device's exact entry overrides only fields it names. The stable key is vendor:product:name, with four-digit lowercase hexadecimal IDs, and is logged as input added when a device appears:
"input": {
"*": {
"tap": true,
"tap_drag": true,
"natural_scroll": false,
"disable_while_typing": true
},
"046d:c52b:USB Receiver": {
"accel_speed": -0.2,
"accel_profile": "flat"
}
}Available fields are tap, tap_drag, natural_scroll, left_handed, middle_emulation, disable_while_typing, accel_speed (from -1 to 1), accel_profile (adaptive or flat), click_method (button_areas or clickfinger), scroll_method (none, two_finger, edge, or on_button_down), scroll_factor, emulate_discrete_scroll, scroll_button, scroll_button_lock and drag_3fg. Unsupported settings are logged and ignored. Settings apply when a device appears and again on config reload.
At runtime. config.input on the control socket sets one device's entry without touching the file, naming it the way the file does. The connected devices are reconfigured at once, and a device that arrives later reads the same map:
viewport msg -t config.input --device '*' --tap true --scroll_factor 0.5Only the fields given change on that device's entry, and an entry that does not exist yet is created. An unnamed device, an acceleration outside -1 to 1, an unknown profile or method, or a zero scroll factor is refused whole.
scroll_factor multiplies both the continuous amount and the discrete steps a device sends — Hyprland's input:scroll_factor, which is the number a touchpad usually wants below 1. Zero is refused and a negative value reverses the direction. emulate_discrete_scroll sends wheel-like steps for a touchpad that only reports a continuous amount, for a client that reads nothing else.
scroll_button — Hyprland's input:scroll_button — pins the button scrolling waits for while scroll_method is on_button_down. Absent lets libinput choose, which is usually the middle button. The number is an evdev button code, not an X11 one: the middle button is 274 here and 2 on the X11 side, so a value read off an X11 mapping needs translating. Zero disables button scrolling. scroll_button_lock — Hyprland's input:scroll_button_lock — makes that button toggle scroll mode on and off instead of having to be held; absent is held. drag_3fg — Hyprland's input:drag_3fg — drags with three fingers down instead of a tap followed by a drag. libinput makes the two the same device setting, so drag_3fg and tap_drag share one state: either set on its own wins over the default, and both set differently leaves tap_drag's value.
Asking for the workspace you are already on takes you back to the one before it, so Mod4+2 pressed twice from workspace 1 goes to 2 and then back to 1 — sway's workspace_auto_back_and_forth, and the same toggle it gives you. Mod4+grave goes back without naming a workspace. The previous workspace is remembered per output and survives a restart along with the rest of the layout.
focus takes next, prev, left, right, up or down. Directional moves compare window centres, so they follow what is on screen — including across monitors — rather than stacking order.
shell forwards the rest of the line to the web shell as {"type":"shell.command","command":…,"args":[…]} and does nothing else. This is the seam for everything that is layout policy: the defaults bind Mod4+1..9 to shell workspace.switch N and Mod4+Shift+1..9 to shell workspace.move N, and what a workspace is is defined entirely in data/shell/commands.js. Add your own commands by binding them and handling the name in handleShellCommand(); no compositor change is needed.
A chord may be scoped to a mode by writing mode/chord, mirroring sway's mode "resize" blocks — resize/h only fires while resize mode is active, so h keeps meaning "focus left" everywhere else. mode NAME switches; the bar shows the active mode.
Only a few things live in C on purpose: focus and pointer grabs, because they need the seat; spawning and exit, because they must work when the shell is broken; /proc sampling and the settings portal, because a web page cannot do either. Everything else — tiling, workspaces, fullscreen, resizing, the bar — is the shell's.
The shell is sent this keymap — the real one, after a config file has had its say — and the empty desktop lists it under the mark. That is why the listing follows a layout: a few chords only exist in one, and a shell showing a table of its own would be describing a keyboard nobody has. Both halves of each row are spelled the way a config file spells them, so a chord you want to change can be copied straight into binds. Turn the listing off with "tutorial": false, which is the same key that hides the rest of it, and the mark it sits under with "logo": false. With both off an empty workspace is empty, which on an OLED panel is two fewer things sitting in fixed pixels.
Default bindings
| Chord | Action |
|---|---|
Mod4+Return / Mod4+d | terminal / launcher |
Mod4+Shift+q / +e / +c | close / exit / reload the shell |
Mod4+Shift+d | toggle dark mode |
Mod4+Shift+v | the clipboard history |
Mod4+Shift+m | the notification centre |
Mod4+Shift+i | toggle notification popup do-not-disturb |
Mod4+Shift+n / Mod4+Shift+t | the Wi-Fi picker / the Bluetooth picker |
Mod4+Shift+k | the on-screen keyboard, which otherwise comes up on its own |
Mod4+Shift+comma | the settings panel |
Mod4+f | fullscreen |
Mod4+m | maximize while keeping bar, gaps, and border |
Mod4+a | focus the parent container |
Mod4+Shift+space | toggle floating on the focused window |
Mod4+b / Mod4+v | next window splits horizontally / vertically |
Mod4+w / Mod4+s | tabbed / stacked containers |
Mod4+e | flip the focused container's layout |
Mod4+n | toggle the bar |
Mod4+o | the overview of open windows |
Mod4+grave | back to the previous workspace |
Mod4+Shift+Return | give the keyboard to the wallpaper terminal, and take it back |
Mod4+Shift+x | lock: idle.lock_command if one is set, the shell's own lock screen if not |
Mod4+Shift+b | lock and blank the screens: the session locks and the outputs stay off until input wakes them to the lock screen |
Mod4+Shift+p | HDR on the monitor you are looking at |
Mod4+Alt+equal / Mod4+Alt+minus | magnify the screen in / out |
Mod4+Alt+0 | the magnifier off, straight back to 1:1 |
XF86AudioPlay / XF86AudioPause / XF86AudioNext / XF86AudioPrev / XF86AudioStop | playerctl play-pause / pause / next / previous / stop |
XF86AudioRaiseVolume / XF86AudioLowerVolume / XF86AudioMute | default sink, five percent a press, with OSD feedback |
XF86AudioMicMute | mute the microphone source, with OSD feedback |
XF86MonBrightnessUp / XF86MonBrightnessDown | brightnessctl, five percent a press, with OSD feedback |
Mod4+Tab / Mod4+Shift+Tab | step through the windows on this workspace |
Mod4+h j k l, arrows | focus, crossing monitors at the edge |
Mod4+Shift+h j k l, arrows | move window, carrying it to the next monitor at the edge |
Mod4+1‑9 / +Shift | switch / move to workspace |
Mod4+r | resize mode; then hjkl, Escape to leave (scrolling and canvas bind it to something of their own; solar leaves it unbound) |
The chords each layout adds to these are listed with the layout below. The drags are not bindings at all: Mod4 with the left button held moves the window under the pointer and the right one resizes it from the corner nearest where the drag started — dragging the gap between windows works as an edge — and the compositor handles both itself. A button that is bound (Mod4+Mouse4, say) fires the binding instead of starting a drag.
Mod4+d opens the built-in launcher: the shell draws it, and the compositor feeds it from the .desktop directories, filtering on what is typed and starting what is chosen with an activation token, so the window that appears opens focused. menu (or VIEWPORT_MENU) names an external menu instead — wmenu-run, fuzzel, whatever — and Mod4+d runs it when one is named.
The pointer
cursor.theme and cursor.size set XCURSOR_THEME and XCURSOR_SIZE for the compositor and for everything it starts, which is what makes the pointer drawn over a window and the one drawn over the desktop the same picture. A theme name with spaces is also looked for hyphenated, because the directory on disk usually is.
cursor.enable_hyprcursor (absent is on, as in Hyprland) lets a hyprcursor theme answer for the configured name first: hyprcursor themes are a manifest and one zip per shape, with per-size images, per-cursor resize methods and animation delays, and they are the only thing that ships a pointer at every size rather than a handful. The name is looked up in ~/.local/share/icons, ~/.icons and the icons directories of $XDG_DATA_DIRS, matching either the manifest's name or the directory's own; a name those themes do not answer falls through to the XCursor theme of the same name, so turning this on never takes a pointer away. HYPRCURSOR_THEME and HYPRCURSOR_SIZE name that theme at start-up the way XCURSOR_THEME and XCURSOR_SIZE name the XCursor one, with the hyprcursor pair winning when both are set. SVG shapes are the one unsupported part: the compositor has no SVG renderer, so those shapes are answered by XCursor instead.
cursor.hide_after_ms takes the pointer off the screen once it has been still for that long — an arrow parked in the middle of a film. Zero or absent is off, which is the default. Any use of the pointer brings it straight back: motion, a button, the scroll wheel, a touchpad gesture or a tablet pen. Typing does not, deliberately — someone writing with the mouse pushed aside is exactly who asked for this, and a cursor that came back on every keystroke would never leave.
cursor.hide_on_key_press is the other side of that, Hyprland's hide_on_key_press: true puts the image away on the next keystroke and brings it back on the next pointer motion. cursor.hide_on_touch does the same for a finger on a touch screen. Absent is off for both. Set them and the cursor leaves when either is idle and when either is used, which is what a desk that wants it gone while it is being typed on or touched — a fullscreen video, a terminal — rather than only while it is not asks for.
Only the drawn image goes. The pointer has not moved, keeps its focus, and clients are told nothing, so a hidden cursor cannot make a page think the mouse left it.
At runtime. config.cursor on the control socket sets the whole block without touching the file on disk — for a keybinding, for a verification tool that needs the pointer drawn in every capture, and for the settings panel, which sends exactly this:
viewport msg -t config.cursor --hide_after_ms 0Each field is optional; only the ones given change. Zero is off, as in the file; a negative deadline, a zero size or a negative threshold is refused whole. A bare viewport msg -t config.cursor — no fields at all — toggles the deadline between never (0) and the shipped 2000, which is what a keybinding wants; naming any field instead leaves the deadline alone. Turning the deadline off while the image is hidden draws it again at once, and turning it on arms the countdown. A new theme or size reloads the cursor images immediately, and follow_mouse with its threshold applies the way the file's does. The current value is in the config event's cursor, and config.save writes it beside the other runtime settings.
cursor.follow_mouse makes keyboard focus follow the pointer: moving the pointer over a window gives it the keyboard without a click. Absent is off.
"cursor": { "follow_mouse": true, "follow_mouse_threshold": 5 }follow_mouse_threshold is the minimum distance in logical pixels the pointer must travel before focus changes. This prevents focus churn from small tremors. Zero — the default — means every motion triggers a focus check. Focus does not follow the pointer while the session is locked, while a window is being dragged, or while the overview is shown.
follow_mouse_shrink shrinks the invisible rectangle a window presents to the hover test — not the window itself — by the given number of logical pixels on each side, Hyprland's cursor:follow_mouse_shrink. A client's shadows and decoration margins are part of the box the hover test sees, so with a shrink on focus only changes once the pointer is genuinely inside the window rather than merely over the padding around it. Zero — the default — keeps the whole bounding box. Clicks, the wheel and drags are unaffected: they still land wherever the pointer really is, because the user aimed at them.
"cursor": { "follow_mouse": true, "follow_mouse_shrink": 4 }cursor.warp_on_change_workspace decides whether switching workspaces moves the pointer to the window that takes focus there, Hyprland's warp_on_change_workspace. Absent — 0 — leaves the pointer where it was, which is what this compositor has always done: focus moves, the pointer does not. 1 warps it to the centre of the focused window on the new workspace; 2 does the same and forces it even when no_warps is set. Anything above 2 is refused — there is no third behaviour to name.
"cursor": { "warp_on_change_workspace": 1 }The warp lands on the window the shell focuses after the switch, so an empty workspace — one whose focus goes to the shell rather than a window — moves nothing. The move goes through the same absolute path a scripted input.pointer takes, so it is clamped to the desk and subject to pointer constraints like any other motion.
cursor.no_warps is the master switch over the compositor moving the pointer on its own, Hyprland's no_warps. Absent is off. Set true, it suppresses the workspace-switch warp above (unless that is 2, which forces past it). It is the whole of what it gates today: this compositor does not warp the pointer on focus or on a keybind the way Hyprland does, so there is nothing else to turn off. A client moving its own pointer through wp-pointer-warp-v1, or a script through input.pointer, is asking for the move rather than having it done to them, and neither is touched.
"cursor": { "no_warps": true, "warp_on_change_workspace": 2 }The magnifier
Mod4+Alt+equal blows up the part of the screen under the pointer, one step at a time; Mod4+Alt+minus comes back down, and Mod4+Alt+0 goes straight to 1:1. The region follows the pointer and is held to the monitor it is on, so moving toward an edge slides it along rather than showing a strip of the neighbouring screen. Only the monitor the pointer is on is magnified: the region follows the pointer, and the pointer is on one screen at a time.
"magnify": { "step": 0.5, "max": 8.0 }step is what one press adds and max is as far as the chords will go. Absent is 0.5 and 8.0. Both are clamped rather than refused — a max below 1.0 is a magnifier that cannot magnify, and a step that is negative is a zoom-in chord that zooms out — and lowering max in a reload brings the picture down to meet it rather than leaving the screen somewhere the config file says is not allowed.
At runtime. config.magnify on the control socket sets the block the same way, and the event carries the clamped, effective values:
viewport msg -t config.magnify --step 0.25 --max 6A step or ceiling that is not a finite positive number is refused whole.
Everything still works where it looks like it does. The pointer is not magnified; the picture is. The compositor's cursor stays at the real place it was, and the cursor is drawn through the same transform as everything else, so a click, a drag, a resize edge and focus-follows-mouse all land on the thing under the drawn cursor. A touchscreen and a tablet in absolute mode are the one exception in the other direction: those name a place on the glass, so they are mapped back through the magnification before anything sees them, which is what makes a finger land on what it was put on.
This is not canvas.zoom, which is a layout the shell draws at a scale and where input only lands where it is aimed at 1.0. The two are unrelated and can be used together, though there is little reason to.
A screen capture — a screenshot, a share, a recording — shows the magnified picture, because it is a capture of what is on the screen.
A screen reader
The desktop is a web page, so the engine drawing it has already built a real accessibility tree; whether that tree reaches AT-SPI depends on which engine it is, and the default is the one that cannot. A desk that needs Orca wants
"shell_backend": "webkitgtk"and an accessibility bus in the session — which the NixOS module in flake.nix turns on by default and other distributions spell as installing at-spi2-core. shell-backends.md has the per-backend detail and the evidence behind each verdict.
Every surface the shell can put on screen — the launcher, the clipboard history, the notification centre, the power menu, a tray item's menu, the two radio pickers — can be steered and finished with the keyboard alone: arrows to choose, Enter to act, Delete where a row can be forgotten, Escape to dismiss. See data/shell/shell.md.
The keyboard
keyboard.layout, keyboard.variant and keyboard.options are xkb's, spelled as setxkbmap spells them, and they are the first thing anyone outside a US layout needs. keyboard.rules and keyboard.model name the xkb rules file and the keyboard model for the desks that have a reason to — an old keyboard whose quirks a model describes, or a layout shipped in a rules file of its own. Absent lets xkb choose, which is what everything else wants:
{
"keyboard": {
"rules": "evdev",
"model": "pc105",
"layout": "de",
"variant": "nodeadkeys",
"options": "ctrl:nocaps,compose:ralt",
"repeat_rate": 25,
"repeat_delay": 200
}
}repeat_rate is repeats a second and repeat_delay is how long a key is held before they start, in milliseconds. Absent is 25 and 200, which is sway's pair and the compositor's.
numlock_by_default latches Num Lock on when the session starts — Hyprland's input:numlock_by_default. Absent is off. It is a startup setting, not a runtime one: it is applied once, after the configured keymap is on the seat, and a reload or a later config.keyboard never forces it back on over somebody who has since switched it off by hand.
The block is read once, at startup — and at runtime too, below. A keymap is set by handing the seat a new keyboard and there is no way to change the layout of one that already exists, so changing it replaces the keyboard. An entire block left out changes nothing, and a layout xkb refuses is logged by name and the current keymap kept, because an unknown layout that silently left the built-in one in place looks exactly like a config file that was never read.
At runtime. config.keyboard on the control socket sets the block without touching the file — the seat's keyboard is replaced, so the new keymap is live at once, and a keymap xkb refuses is rejected with the old one standing:
viewport msg -t config.keyboard --layout de --repeat_rate 30Only the fields given change, and the empty string takes one back to the xkb default. A repeat rate or delay of zero or below is refused whole.
Chords are separate: binds names them by keysym, so the same binding follows the layout rather than the key's position. See Changing some of the keymap, or all of it.
A picture or a film as the wallpaper
wallpaper names what to draw as the desktop background, and wallpaper_mode says how it is fitted to the screen. It is usually a picture; it can be a video file, played as an animated one — see Animated wallpapers below.
{
"wallpaper": "~/Pictures/wall.png", // a path or URL, picture or video
"wallpaper_mode": "fill", // fill, fit, stretch, center or tile
}It does not have to be a picture. A CSS value is passed through to the page untouched, so a colour scheme with no photograph in it is one line:
{
"wallpaper": "#1a1b26", // a flat colour
"wallpaper": "linear-gradient(#1a1b26, #24283b)", // or a gradient of yours
"wallpaper": "url(/pic/wall.png)", // the CSS spelling works too
}A value is read as CSS when it is #rrggbb, transparent, or anything of the form name(...) — rgb(), hsl(), every gradient(), url(). Everything else is a path, which is why a colour has to be written as #000000 or rgb(0,0,0) rather than black: a bare word is a relative path as far as this can tell, and there is no way to have both. wallpaper_mode applies to pictures and gradients; a flat colour has nothing to fit.
or on the command line, which wins over the file:
$ viewport --wallpaper ~/Pictures/wall.png --wallpaper-mode fitor at runtime, over the control socket, which is what a wallpaper cycler uses and what the settings panel's own picture field sends — no config reload, nothing written to disk until a config.save:
$ viewport msg -t config.wallpaper --path ~/Pictures/other.png
$ viewport msg -t config.wallpaper --mode tile # the picture stays
$ viewport msg -t config.wallpaper --path '' # and this removes itThe five fittings, which are background-size under the skin for a picture and object-fit for a video:
| mode | what it does |
|---|---|
fill | covers the screen, cropping whatever overflows. The default |
fit | the whole picture, letterboxed against the desktop colour |
stretch | covers the screen, distorting the picture to do it |
center | at its own size, in the middle |
tile | at its own size, repeated |
cover and contain are accepted as other names for fill and fit, because that is what sway's output bg calls them.
The shell paints it, and the compositor resolves it. The page is the bottom layer of the desktop, so an image there is one the page loads: what the compositor does is turn the path into a URL, check the file is actually there, and send it with the rest of the config. A CSS value has no file to find and is handed over as written. A path that is missing is a line in the log for the config file, an error on the socket, and a refusal to start for the flag — never a background that silently does not change, which is the one failure worth engineering against here.
A consequence: the picture is loaded by whichever engine draws the shell, so it can be any format that engine reads — PNG, JPEG, WebP, SVG, an animated GIF or an animated WebP — and a https:// URL works as well as a path. A custom shell has to honour wallpaper in the config event; the shipped one does.
Animated wallpapers
An animated picture needs nothing special said about it: a GIF (or an animated WebP or APNG) is a picture, the engine animates a background-image of one, and all five fittings apply as they do to a still. That animation is the engine's, so a minimal decoder that does not run one shows its first frame; the setting has still done exactly what it says.
A video cannot be a background-image, so the shipped shell plays it on an element of its own, under everything the desktop draws. wallpaper names one the same way it names a picture, and the extension picks the element: .mp4, .m4v, .mov, .webm, .ogv or .mkv. It is played muted and looping, with no controls, and it cannot take input meant for the desktop.
fill is the default; fit, stretch and center mean what they mean for a picture. tile is the one that does not carry over — repeating a film would be a grid of decoders out of step with each other — so a video in tile fills the screen. That is the nearest a screen can come to what the mode asks a moving image to do. The mode is otherwise a picture's and is not refused, because a wallpaper cycler sets the fitting and the file independently.
The codec, like the picture format above, is the engine's. webkitgtk and Chromium are built with the common ones; an engine without a decoder shows the desktop colour behind the element rather than a frame.
A terminal wins over anything in the page. With background_terminal on, the page goes transparent so the terminal behind it can be seen, and a picture or a film in the page would be painted straight over it. Nothing is refused — the setting is simply not in force while a terminal is behind, and the shell stops and unloads a video for as long as it is — so turning the terminal off brings the picture back and starts the film again.
A wallpaper program still wins over both, per screen, in the way described below: swaybg and the rest draw on the background layer, which is over the whole desktop including this.
stylix
stylix themes a NixOS or home-manager session from one image, and this reads its two settings unchanged — the mode names here are stylix.imageScalingMode, which is why they are spelled that way. Point the compositor at them:
# NixOS, wherever the compositor is launched from
programs.viewport.extraArgs = [
"--wallpaper" "${config.stylix.image}"
"--wallpaper-mode" config.stylix.imageScalingMode
];or, if the config file is generated rather than the command line:
xdg.configFile."viewport/config.json".text = builtins.toJSON {
wallpaper = "${config.stylix.image}";
wallpaper_mode = config.stylix.imageScalingMode;
# And the colours, which are the other half of a themed desktop.
theme = with config.lib.stylix.colors.withHashtag; {
background = base00;
foreground = base05;
accent = base0D;
};
};config.stylix.image is a store path, so the file is there for as long as the generation is — which is the case the existence check was written for, since a garbage-collected picture would otherwise be a desktop that came up grey.
Stylix's own targets do not know about this compositor, so nothing sets it behind your back; if stylix.targets.swaybg (or another wallpaper program) is enabled in the same session, that program takes the background layer and wins per screen, as above. Turn it off, or leave wallpaper unset and let it do the job.
A terminal as the wallpaper
background_terminal runs a terminal emulator on every monitor and draws each behind everything — under the windows, under the bar, in place of the desktop background.
{
"background_terminal": true, // the "terminal" configured above
"background_terminal": "foot -e btop", // or something specific
}or --background-terminal on the command line, bare for the configured terminal and --background-terminal='foot -e btop' for a command of its own. Absent or false is off, which is the default.
Input reaches it only when you ask, by name. Mod4+Shift+Return — the background action, or {"type":"background.focus"} on the control socket — gives the keyboard to the wallpaper terminal on the monitor you are looking at, and the same chord gives it back to the window that had it. That is the whole of the way in.
Nothing else can put focus there. The terminal is not a window: it is not registered as a view, so view.focus cannot name it and the shell is never told it exists; it is not in the window space, so a click on the desktop passes over it; and it is not the shell, so the key path that delivers to the desktop does not reach it either. There is no click-to-focus and no focus-follows-mouse for it, deliberately.
The reason for the asymmetry is that a wallpaper is the one surface on the screen that is always present, always unobscured at the edges, and never deliberately focused. A terminal there that drifted into focus would be a shell prompt underneath every window, and every way focus can go wrong — a window closing between two keystrokes, a race while the next window is focused, a password typed a moment after its prompt disappeared — becomes a way for input to arrive at a command line. A chord you pressed is not one of those ways, which is why that one is allowed and the accidents are not.
What the compositor gains is nothing: it spawns the command with /bin/sh -c, which is what an exec keybinding already does, and the emulator owns its pty exactly as it does in a window. No IPC verb runs a program, and none was added for this.
Two other consequences worth knowing:
- It is in screenshots and screen shares. The wallpaper is part of every frame, so whatever is on it is part of anything that captures the screen.
- The shell stops painting its own background. The page is the bottom layer of the desktop and its gradient is the wallpaper, so with this on the compositor tells the shell to leave it transparent and the terminal shows through. A custom shell that paints an opaque background of its own will cover it; honour
background_terminalin theconfigevent. - It needs
wpeorwebkitgtk. Those two composite the page over nothing. Chromium does not, in either of the two ways this ships it: with CEF'sbackground_colorset to transparent on the browser settings, the view and the window, the composited output is still Chromium's own#1f1f1facross the whole screen — windowed Chromium has no translucent-surface path on Wayland, and its transparent-painting one is windowless rendering, which is a different backend to this. Onceforchromiumthe terminal is therefore not started at all, and the log says so: an invisible terminal under an opaque desktop is a process nobody can see spending a core. Since the default package ischromium, using this means--shell-backend=webkitgtk.
One per screen, not one across the layout. A terminal is a grid of cells and the cells have to land on a monitor: stretched across two, half the columns are on the other one and every line is cut down the middle by the gap between them. So each output gets a process of its own, sized to that output, plugged in and unplugged with it. Each is told which screen it is on through VIEWPORT_OUTPUT, which is how one setting can do something different per monitor:
{
"background_terminal":
"sh -c 'case $VIEWPORT_OUTPUT in DP-1) foot -e btop;; *) foot -e journalctl -f;; esac'"
}Each is restarted if it exits, up to five times a minute, and then left down with a line in the log.
A wallpaper program wins, per screen. swaybg, hyprpaper, wbg and the rest are layer-shell clients on the background layer, which is drawn over everything the terminal puts on that monitor — so when one appears the terminal on that monitor is asked to close, and is killed five seconds later if it ignores that. swaybg -o DP-1 therefore takes one screen and leaves the terminal on the other. When the program goes, that screen's terminal comes back. Running both is otherwise a program painting frames nobody can see, which on a laptop is a core's worth of battery spent on a picture that is covered up.
Dark mode
Styling the shell cannot make client applications dark. Firefox, GTK and Qt each ask the same question — color-scheme in the org.freedesktop.appearance namespace, over D-Bus through xdg-desktop-portal — and with nothing answering they all default to light.
"dark_mode": false is what the session starts on; absent is dark, which is what the shell is drawn for. Mod4+Shift+d flips it at runtime, and so does the settings panel's switch — over the socket as config.dark_mode, which names the state rather than flipping it, because a switch pressed twice has to end up where it says it is:
viewport msg -t config.dark_mode --enabled false
viewport msg -t config.dark_mode # absent togglesAll three end in the same call, and the portal signals the change every time, so applications already running follow it. It changes nothing the shell draws: the desktop's own palette is dark, and this is the answer given to Firefox, GTK and Qt.
game_mode is one toggle for gaming: it strips the shell's animations, hides the bar and pauses the wallpaper drift, cutting compositing overhead and distraction, and restores all three on the way out. The motion pace is zeroed while it is on and the configured pace comes back when it is off; the bar hides through the same relayout that hides it in auto mode; and the active wallpaper extensions are asked to pause (a pause/resume hook on the descriptor, with a CSS fallback that pauses animations for extensions that declare none). Bind it with the game-mode action, or flip it over the socket as config.game_mode (absent toggles, like config.dark_mode):
viewport msg -t config.game_mode --enabled true
viewport msg -t config.game_mode # absent togglesIt is adjacent to a streaming mode but compositor-side and about overhead rather than capture: nothing is recorded, the desk simply stops animating itself while a game has the screen.
That answer normally comes from a desktop environment. There isn't one here, so the compositor implements org.freedesktop.impl.portal.Settings itself. The GSettings route is deliberately avoided: it needs dconf and GNOME's schemas installed, and silently does nothing when they are absent.
Three things must line up, and start.sh handles all of them — running from a build tree gets none of them for free:
XDG_CURRENT_DESKTOP=viewport | the portal picks a backend by matching this against each .portal file's UseIn= |
XDG_DATA_DIRS | it only finds viewport.portal if that directory is on the search path |
dbus-update-activation-environment | the portal is D-Bus activated and inherits its environment from the session, not from the compositor |
Setting XDG_CURRENT_DESKTOP with setenv() in the compositor is not enough: the portal is a separate, already-running process. Verify with:
gdbus call --session --dest org.freedesktop.portal.Desktop \
--object-path /org/freedesktop/portal/desktop \
--method org.freedesktop.portal.Settings.ReadOne \
org.freedesktop.appearance color-scheme # (<uint32 1>,) means darkChanging some of the keymap, or all of it
There are two keys, and which one you want depends on how much you are replacing.
binds_override changes the chords it names and leaves every other built-in alone. This is almost always the one to reach for:
{
"binds_override": {
"Mod4+Return": "exec foot",
"Mod4+d": null
}
}Mod4+Return now opens foot instead of the built-in terminal, Mod4+d reaches the focused application instead of opening a launcher, and the other hundred bindings are untouched. A null — or the action "none" — unbinds a chord. That is not the same as leaving it out: leaving a chord out is exactly what asks for its built-in, so removing one has to be said out loud.
binds replaces the built-in keymap entirely. Defining any binds object suppresses the defaults, so an empty one means "no keybindings at all", which is the point of it — it is how you start from nothing.
One binding survives that: if nothing in the resulting keymap quits, and Mod4+Shift+E is free, Mod4+Shift+e=exit is added back. A config file that did not think about it cannot produce a session with no way out of it, and a --url session — a web page and nothing else, no launcher and no terminal to reach — is where that matters most. A file that binds Mod4+Shift+E to something else is left alone and warned about: Ctrl+Alt+Backspace is the chord underneath that no config file can take away.
Both accept the same CHORD: ACTION entries, and a chord written twice takes its last definition. data/config.example.json is a fuller starting point.
An entry may also be an object, which is how a binding explains itself — Hyprland's bindd. action is the action the string form would carry, and description is shown instead of the raw action wherever bindings are listed: the tutorial on an empty desktop, and bind.list on the socket. An object with no action claims the chord and does nothing, exactly as a null does.
{
"binds_override": {
"Mod4+Return": { "action": "exec foot", "description": "open a terminal" },
"Mod4+d": null
}
}Anything you bind beats a built-in for the same chord regardless of which key it came from, and --bind on the command line beats both.
A web page on one monitor, the desktop on the rest
url — or --url — names the page the session shows. With one monitor it is the desktop: it gets the whole screen, and whether it lays windows out is up to what the page does. That is the shell being developed (--url http://localhost:3000) and it is also a kiosk (--url https://example.com, one screen, one site, nothing else).
With two monitors or more the two readings come apart, so they are split:
- the page takes the first monitor — first by the order the outputs were detected, which is the order the session came up in, not by position;
- the shipped desktop runs on the rest, in a second shell process of its own.
So --url https://example.com on a two-monitor desk is that site on the main screen and a working desktop — bar, windows, workspaces — on the other, rather than one page stretched across both and no window manager anywhere. A non-loopback remote URL is refused unless VIEWPORT_ALLOW_REMOTE_SHELL=1 is set: the page can run commands through the shell bridge, so remote origins are an explicit trust decision rather than a value a config file can choose by itself. file: and loopback (localhost, 127.0.0.1, [::1]) URLs need no override.
"url_span": true, or --url-span, puts it back to one page across every screen. That is what a shell under development wants: it is the desktop, it just is not the shipped one.
Monitors can arrive and leave at runtime and the arrangement follows. Plugging a second screen into a --url session starts the desktop on it without restarting the page — same process, same document, a resize — and unplugging it hands the page the whole desk back.
Only the desktop page is sent window events, given the keyboard by shell.focus, or drawn above windows for shell.overlay. The other is a web page: it receives pointer and keyboard input on its own screen like any client, and nothing else.
Each page's world is its own rectangle. A page lays out in a document that starts at (0, 0) however far across the desk the page itself begins, so:
output.layoutsent to a page lists only the screens it covers, with positions relative to its own top-left. A desktop confined to the second monitor is told about that monitor, at+0+0, and is not told the first one exists — it must not place a window on a screen it does not cover.view.layout,shell.overlayandscreencast.rectcoming back from a page are read in that page's coordinates and moved into the layout's.
A script on the control socket has no page to speak in, so it speaks layout coordinates and is told the layout as it really is. Which connection is a page is decided by the pid the kernel reports for it (SO_PEERCRED), matched against the processes the compositor started — a client cannot claim to be the desktop, because it does not choose its own pid.
viewport=debug logs both halves: shell N: its screens are … for what each page was told, and view N: placed at …; the page asked for … for where a window ended up and what was asked for.
This is implemented for the out-of-process backends — webkitgtk and chromium, and cef when it lands. The in-process wpe backend still runs one engine across the whole layout, so --url there behaves as it always did.
Running one application: kiosk mode
"startup": "COMMAND" runs one command once the compositor is up, and is how a kiosk names the application it exists to run. Nothing restarts it if it exits — that belongs to a service manager, which can back off, log and give up.
"vt_switching": false stops Ctrl+Alt+F1..F12 leaving the session. This is the escape hatch and it is the last thing to turn off. It is checked before the config file, before the keymap and before the shell, so it is the one thing that still works when a shell never paints or the compositor wedges; without it the only ways back are SSH and the power button. A public kiosk usually does want it gone — a visitor reaching a login prompt is the threat — but disable the getty units on the other VTs too, since this stops the compositor handing over the keys rather than removing the consoles they would have reached. Only an explicit false turns it off: a missing file, a malformed value or a null all leave it on, and turning it off is logged at startup.
examples/kiosk/ is a complete worked example — a shell that draws one application fullscreen and ignores everything else, a config that locks the machine down, and a README about what that does and does not achieve.
Precedence is flags > config file > defaults.
--drm take the screens and the seat: a session of its own, from a TTY
--headless no renderer and no window: everything but drawing, for tests
--width N the headless output's width (default 1920)
--height N and its height (default 1080)
--config PATH the config file, instead of the default one
--layout NAME tiling, scrolling, solar, matrix or canvas, over the config
--renderer NAME vulkan or gles, over $VIEWPORT_RENDERER
--pixel-format N scanout bits per channel: 8, 10 or auto, over $VIEWPORT_PIXEL_FORMAT
--shell-backend NAME which engine draws the desktop; see docs/shell-backends.md
--url URL a page to run instead of the bundled desktop
--url-span give that page every monitor, not just the first
--watch-shell reload the shell when its files change
--watch-config reload the configuration file when it changes
--background-terminal [CMD] a terminal for a wallpaper, running CMD if one is given
--wallpaper PATH a picture or video for the desktop background, over the config file
--wallpaper-mode NAME how it is fitted: fill, fit, stretch, center or tile
--socket PATH the control socket, instead of the one named after the display
--exit-after SECS stop after this long, in case stopping is what is broken
-h, --help thisThat is the whole list — OPTIONS in crates/viewport/src/main.rs is both what --help prints and what an argument is checked against, so there is nowhere else for a flag to hide. There are no short forms other than -h, and an option that is not on this list is not an error: it is logged as unknown option …; it has been ignored and the compositor carries on. --url has no default of its own — with nothing given, the shell is the bundled desktop, loaded from a file:// URL beside the binary.
viewport msg takes its own options; viewport msg --help lists every message and its fields, and IPC is what they do.
Screen sharing and remote control
Both are portals, both are answered by the compositor itself, and both put the same dialog on screen before anything happens.
org.freedesktop.impl.portal.ScreenCast is why a browser can share a window here. The usual backend is xdg-desktop-portal-wlr, which can only offer monitors — it captures through wlr-screencopy, which captures outputs and nothing else — so an application asking for a window was handed a whole screen. The chooser lists every window and every monitor, plus three sources that name whatever is in front at the time: all monitors at once, the focused window, and the active monitor.
org.freedesktop.impl.portal.RemoteDesktop is the same interface with input added — a remote-support tool, or a call where the other end takes the mouse. The dialog says which devices are being asked for (keyboard, mouse, touchscreen), because that is the part being agreed to, and Enter allows all of them while Esc refuses. An application that also asked for a picture gets the source list underneath, and the one choice covers both.
Two things it deliberately will not do. It never remembers a grant: a screen share can be restored from a token so that OBS finds the same monitor months later, and the same trick applied to a keyboard would be a process that can type into this machine on the strength of a blob in the permission store. And it refuses outright when the desktop page is not drawing, so a broken shell cannot become a way in. Screen sharing follows the same fail-closed rule: without trusted consent UI, no source is shared.
Registering both needs the same three environment variables the Settings portal needs, listed under Dark mode above; start.sh sets them. data/portal-config and data/portal-share are the two files that name this compositor as the backend, and they have to name it for both interfaces — the frontend uses one session handle across the two, so a configuration that sends ScreenCast here and RemoteDesktop somewhere else cannot work.
Gaps
The space around and between windows. Every layout model reads the same values: the tiling tree's dividers, the scrolling strip's columns and the matrix's slots all come out of them, so a few numbers space the whole desktop.
{
"gaps": { "inner": 8, "outer": 0, "smart": false }
}gaps.inner is the gap between adjacent windows, in pixels. gaps.outer is extra space around the edge of the output, added on top of the inner gap — so the space where the desktop meets the screen edge is inner + outer, while between two windows it is still just inner. gaps.smart, when true, drops the inner gap on a workspace that holds a single window filling the tiling area, so a lone window does not sit far from its own screen edge. In the scrolling layout a column keeps the width it was given, so this applies only to a lone column at full width: a half-width column does not reach the screen edge anyway, and collapsing the gap around it would only move it. Absent fields keep the shell's defaults: inner 8, outer 0, smart off.
The same custom properties are what the theme keys gap and gap-outer set when you want to choose the units yourself; gaps.inner / gaps.outer are the explicit options and win when both are present. Either way they land on --gap and --gap-outer, which the layouts read back at layout time, so a change takes effect on the next reload.
At runtime. config.gaps on the control socket sets the gaps without touching the file on disk — for a keybinding, for trying values before editing the config, and for the settings panel's own two boxes, which send exactly this:
viewport msg -t config.gaps --inner 8 --outer 0 --smart falseEach field is optional; only the ones given change. It updates the compositor's config and re-announces it over the same channel a config reload uses, so the change applies immediately. A gap of zero is accepted deliberately; a negative gap is refused.
Window borders
The frame drawn around a window.
{
"border": { "radius": 6, "width": 2, "smart": false }
}border.radius is the corner radius in pixels, measured on the outside of the border. Absent keeps the shell's default of 6; zero is a square desktop. border.width is how thick the border is, in pixels. Absent keeps the shell's default of 2; zero draws no border at all, leaving the gap between windows to separate them.
border.smart squares the corners of a workspace's lone window, the way gaps.smart drops its inner gap — sway's smart_borders for the same window. Absent is off, and it is its own setting: gaps.smart says nothing about it. As with the gaps, the scrolling layout counts only a lone full-width column — a half-width one does not reach its own screen edge to begin with.
It used to follow gaps.smart, on the argument that smart gaps push a lone window against the edge of the screen and a rounded corner there is a notch of wallpaper in the corner of the monitor. The argument holds and the default did not: a radius that had been asked for went unhonoured on every desktop with a single window on it, and came back when a second one opened, which reads as a broken setting rather than as a rule. Anyone who wants that behaviour asks for it with "border": { "smart": true }.
Which window is the lone one is a question about the layout, so the shell answers it and sends square on that window's view.layout; the compositor takes the corner off the crop when it is told to, and works nothing out for itself.
These are the appearance settings the compositor reads as well as the shell. A window's contents are a client surface the compositor draws itself, not part of the page — so a rounded frame with the client's square corner sitting on top of it is a rounded frame nobody can see. The compositor crops each client to the same corner the page drew, tighter by the border's width so the two curves are concentric. Fullscreen windows keep their square corners, as they lose their border.
The corner is cut rather than shaded: there is no antialiasing on it, because the DRM path draws through a Vulkan renderer with no shader hook of its own and rounding only the nested backend would be worse than rounding neither. What steps is the edge between the client and the border behind it, both of which are drawn — not the outline of the window against the wallpaper, which is the page's own antialiased curve.
The theme key radius sets --radius, which --window-radius follows, so a theme still rounds the whole desktop at once. The compositor cannot read CSS, though: a theme that changes radius and leaves border.radius alone moves the frame the page draws without moving the crop, and the client is cut to a corner that is no longer there. Set both, or set border.radius.
At runtime. config.border on the control socket, the same way config.gaps works:
viewport msg -t config.border --radius 12 --width 3 --smart trueEach field is optional; only the ones given change. Zero is accepted for either; a negative value is refused.
"decorations": "client" hands the frame back to the client instead: the compositor tells xdg-decoration and the KDE server-decoration manager alike that the application should draw its own titlebar. Any other value, and absence, keeps the frame here — which is what the shell's border is. Both protocols are answered with the same setting, since a client that probes the manager and one that asks per surface must not be told different things.
At runtime. config.decorations flips the policy without touching the file:
viewport msg -t config.decorations --mode clientAnything but client keeps the frame here, as in the file. The advertised default moves with it, and the frames repaint.
Motion
{
"motion": {
"enabled": true, // false is the system's reduced-motion setting
"duration": 180, // the ordinary transition, in milliseconds
"slow": 320, // entrances and larger moves
"ease": "cubic-bezier(0.2, 0.8, 0.2, 1)"
}
}Nearly every transition on this desktop is the shell's — the close fade (windows_out, below) is the one the compositor draws, because the window is gone before the shell hears of it — and the shell's motion has always been three custom properties in data/shell/shell.css. That is the right answer for a desktop that is a web page and it had no key that reached it: tuning a duration meant shipping a stylesheet. motion is the key. It lands duration on --anim, slow on --anim-slow and ease on --ease, so the stylesheet transitions and the JavaScript tweens run on the same curve.
enabled: false is the system's prefers-reduced-motion setting said in another place, for a session whose environment cannot set it — a kiosk with a fixed user agent, or a desk where only the config file is under your control. The system setting wins either way: a configured duration never overrides a user who has asked their whole desktop for less motion. Absent fields leave the stylesheet's values; a negative or non-finite duration is refused and the previous value kept, with a line in the log naming the key.
The tree
Hyprland's animation block is a tree: windowsIn, windowsMove and workspaces are leaves that may be given their own pace, curve and style, with windows as the default they inherit from. This is that tree, one key each:
{
"motion": {
"duration": 130,
"ease": "cubic-bezier(0.2, 0.8, 0.2, 1)",
"bezier": [0.2, 0.8, 0.2, 1], // the same curve, as four numbers
"windows": { "duration": 160 }, // the default for the three below
"windows_in": {
"style": "popin", // fade | popin | zoom | slide | slidefade | gnomed
"duration": 180,
"spring": { "mass": 1, "stiffness": 400, "damping": 40 }
},
"windows_out": { "style": "fade", "duration": 200 }, // fade | slide | slidefade | zoom
"windows_move": { "duration": 110, "bezier": [0.2, 1, 0.3, 1] },
"workspaces": { "style": "slidefade", "duration": 220 },
"layers": { "duration": 200, "ease": "ease-out" },
"border": { "duration": 150 },
"fade_dim": { "duration": 250 },
"fade_popups": { "duration": 150 }
}
}A leaf names what it wants and inherits the rest: pace, curve, spring and the on/off switch come from windows, then from the block itself. The style is the leaf's own, because the styles a category may name are different ones — a popin opening is not a workspace switch. An unknown style, or a value that is not a number, is dropped with a line in the log and the inherited value stands, so one bad leaf does not turn the whole desktop's motion off.
windows_in styles: fade (opacity only), popin (grows from 85%), zoom (shrinks from 115%), slide (in from the side of the monitor the window is nearer, at full brightness), slidefade (a shorter version of that slide, with a fade) and gnomed (rises 24 pixels with a fade). workspaces styles: fade, slide and slidefade, which is what a workspace switch uses to bring its windows on screen — slide has no fade, slidefade is both.
layers is the shell's own furniture — the bar arriving, a notification opening or leaving, the screen-share dialog — which on this desktop is the shell drawing itself rather than a layer-shell client. It accepts fade (the only style there is, since a measured layer may move no rectangles) and a pace. border is the frame around a window changing colour, which in practice is focus moving. Hyprland's borderangle and shadowangle do not exist here: the frame is a flat colour, not a rotating gradient, so there is no angle to animate. Both inherit the block's pace and curve, not windows'.
bezier is the curve as four numbers — x1, y1, x2, y2 — for a desk that would rather not write the function out; it wins over ease in the same block. A spring is the other way to write a curve: a physical spring that overrides both pace and curve, integrated closed-form per frame, with mass, stiffness and damping as the reference implementation defines them (a damping of 2 * sqrt(stiffness * mass) is critical). Absent spring fields default to 1, 400 and 40. A spring is honoured by the animations the shell drives frame by frame — window entrances and the slide a relayout animates; a container's own flex transition is CSS and runs on its curve.
Per-workspace animation is on the workspace rule itself — see the workspace section above.
windows_out is the close, Hyprland's windowsOut, and the one transition the compositor draws rather than the shell. A window closing is unmapped before the shell hears about it — the client destroys its surface — so there is no element left for the page to animate. The compositor keeps the last frame it drew of the window instead and fades that out. It accepts fade, slide, slidefade and zoom (the entrance-only popin and gnomed are not exits): fade drops the opacity, slide carries the window off the nearer side of its monitor at full brightness, slidefade does both, and zoom shrinks it toward its centre while it fades. Absent is a fifth of a second fading.
"motion": { "windows_out": { "style": "fade", "duration": 200 } }The ghost is drawn above the windows until its fade is spent, then dropped. A window nobody can see — minimized, hidden, one whose rule forbids capture, or a locked session — is removed without a ghost, and motion.enabled: false (or the system reduced-motion setting) removes every window at once, as before. A surface that dies before the compositor can photograph it falls back to that instant removal rather than fading a blank.
fade_dim and fade_popups are the compositor's too, for the same reason: inactive-window dimming is an opacity multiplier the compositor applies, and popups are surfaces it draws, so neither is a transition the page can run on a live element. fade_dim (Hyprland's fadeDim) eases a window's opacity toward its target over the leaf's duration, so focus moving dims an inactive window smoothly rather than in one frame; a window caught mid-fade reverses from where it is. fade_popups (Hyprland's fadePopups) fades a popup in as it arrives. Both take a duration and a curve or spring, and inherit from the motion block's root rather than from windows; absent is a fifth of a second, and motion.enabled: false snaps them as before.
"motion": { "fade_dim": { "duration": 250 }, "fade_popups": { "duration": 150 } }At runtime. config.motion on the control socket sets the block without touching the file — a wallpaper cycler's cousin for animation, and what the settings panel sends:
viewport msg -t config.motion --duration 120 --ease linearEach field is optional; only the ones given change, and the tree's leaves are the file's — the runtime message names the block's own pace and curve only. A negative or non-finite duration or slow is refused whole. The shell reapplies the block from the re-announced config, so a changed pace takes effect on the next transition rather than at the next restart.
A window that stops responding
misc.enable_anr_dialog decides whether the compositor asks about a window that has gone quiet — Hyprland's misc:enable_anr_dialog. Absent is on.
"misc": { "enable_anr_dialog": true }The compositor pings each mapped window once a second over xdg_wm_base's ping/pong, the protocol's own liveness contract. A window that has not answered within five seconds is flagged, and the shell draws a dialog over the windows asking whether to Wait or Force Quit. Wait leaves the window be and asks again on a later round if it stays quiet; Force Quit disconnects the client with the protocol's unresponsive error. A window that answers its ping again takes the dialog down on its own. Only xdg windows are pinged — an X11 window has no such ping, so it is left alone. Set false to leave a quiet window untouched.
Window opacity
{
"opacity": { "active": 1, "inactive": 0.9, "fullscreen": 1 }
}These non-negative values are compositor-side multipliers. active applies to the focused window, inactive to every other window, and fullscreen replaces that choice while a window is fullscreen. Absent fields retain their current value; all three start at 1. Final alpha is clamped to 0..1.
Opacity policy multiplies, rather than replaces, opacity supplied by a layout or fade animation. This matters for layouts such as solar: an inactive multiplier of 0.9 applied to a layout opacity of 0.4 produces 0.36, not 0.9.
At runtime. config.opacity on the control socket sets the three multipliers without touching the file:
viewport msg -t config.opacity --inactive 0.85Each field is optional; only the ones given change. A negative or non-finite value is refused whole.
Bar widgets
The bar ships with a fixed set of modules — clock, CPU, memory, load, root disk, network. bar_widgets adds to that set without touching it: leave the key out and the bar is exactly as it shipped. Each entry names a widget and its options:
{
"bar_widgets": [
{ "type": "disk", "path": "/home" },
{ "type": "volume" },
{ "type": "weather", "location": "New York" },
{ "type": "ai", "provider": "claude" }
]
}disk shows the free space on a mount. path defaults to /. Several can be listed, one per mount you want to watch. Free and total bytes are sampled by the compositor with the rest of the status — the page cannot read statvfs any more than it can read /proc — so they appear as soon as the status does, and update with it.
volume shows the default audio sink's volume and mute state. The compositor asks the session's PipeWire, via wpctl (wpctl get-volume @DEFAULT_AUDIO_SINK@), once per status sample; when there is no wpctl, no session bus or no sink, the widget is simply left empty rather than failing. Like the other modules, it uses the V-shaped audio glyph and when muted.
mic is the same widget aimed at the microphone: it shows the default audio source's volume and mute state, read through wpctl get-volume @DEFAULT_AUDIO_SOURCE@. It uses the microphone glyphs and when muted. A muted node keeps showing its percentage — muting silences output, it does not zero the knob — only the glyph changes.
weather shows the current conditions (temperature and a condition glyph) for a location. It is the one widget the shell fetches for itself rather than the compositor sampling: the page can reach the network even where it cannot read /proc. It uses open-meteo — no API key, answers from any origin — resolving the location through its geocoding service, then reading temperature_2m and weather_code. A bare "location": "New York" is the form to use; several weather widgets may list different places. Refreshed every fifteen minutes, and left empty on failure rather than crashing the bar.
mpris shows what is playing, with the buttons to drive it. Every media player on a Linux desktop publishes MPRIS — a bus name beginning org.mpris.MediaPlayer2., an object, and metadata behind it — which is why playerctl works everywhere; the compositor reads it, because the page has no bus and a widget that shelled out twice a second would be two processes a second on an idle desktop. It is the one widget that is not a line of text: a cover, a previous, a play/pause and a next button, and the track. Only the buttons the player answers for are drawn — CanPause is false on a live stream that can only be stopped, and a button that does nothing is worse than no button. Clicking the widget anywhere else is play/pause and scrolling it skips, up for the track before and down for the one after. Where several players are running, the one that is playing wins over one that is paused, which is the rule playerctl uses. Nothing playing draws nothing at all.
A volume widget is optional plumbing on the compositor: since the default bar does not show volume, the wpctl subprocess is only spawned when a volume or mic widget is present, and only then does a status sample pay for it (one subprocess per audio widget kind). The same goes for the extra mounts — a bar with no widgets stats nothing extra. mpris is the same rule taken further: with no media widget on the bar, the compositor opens no connection for it, starts no thread and follows no player.
battery shows the charge, from UPower's DisplayDevice. The compositor reads it — the page has no bus — and only while this widget is on the bar. Clicking it opens the power picker: the power profiles the daemon offers (power-saver, balanced, performance), the same way the clipboard picker lists history, and below them the rows that are on whether or not it offered a profile — suspend, power off, reboot and quit. The first three go to logind (Suspend, Reboot, PowerOff), answered even with no widget on the bar; quit is Request::Quit, this compositor itself, not a fourth word handed to logind. No battery, or no UPower, draws nothing at all. Lid policy can still talk to UPower with no widget on the bar; see lid below.
ai shows AI account capacity. provider is claude, openai or openrouter. Claude and OpenAI show the usage percentage for each subscription window the account reports; OpenRouter shows purchased credits less usage. The compositor polls every five minutes on a worker thread. A failed refresh keeps the last good value, and an account with no usable credential draws nothing.
Credentials are read by the compositor, not sent in the config event to the web shell. Existing CLI logins are used automatically; environment variables take precedence:
| provider | environment | login file fallback |
|---|---|---|
claude | CLAUDE_CODE_OAUTH_TOKEN | ~/.claude/.credentials.json from claude login |
openai | OPENAI_ACCESS_TOKEN, OPENAI_ACCOUNT_ID | ~/.codex/auth.json from codex login |
openrouter | OPENROUTER_API_KEY | none; use an OpenRouter management key |
The variable names can be changed without putting a token in JSON:
{ "type": "ai", "provider": "claude", "token_env": "WORK_CLAUDE_TOKEN" }
{ "type": "ai", "provider": "openai", "token_env": "CODEX_TOKEN",
"account_id_env": "CODEX_ACCOUNT_ID" }Set custom variables in whatever starts Viewport; exporting them in an unrelated terminal does not change an already-running compositor. Default variables and login files are checked again on each poll, so a CLI rotating its OAuth token is picked up. Token values are never sent to the shell or logged.
OpenAI can also sign in without Codex already configured. With an OpenAI widget and no usage available, the bar reads OpenAI sign in. Click it to start OpenAI's device authorization flow: Viewport opens the verification page and puts the one-time code on the bar. After approval it stores the access, ID and refresh tokens in $XDG_CONFIG_HOME/viewport/openai-auth.json (or ~/.config/viewport/openai-auth.json) with mode 0600, refreshes them before expiry, and fetches usage immediately. The code expires after fifteen minutes. Only continue a device login started by that click; never enter a code supplied by another person or site.
OpenRouter's credits endpoint is public API. Claude's OAuth usage endpoint and OpenAI's wham/usage endpoint are undocumented interfaces used by their own tools and may change. A changed endpoint leaves the last value standing and logs ai usage: ... refresh failed rather than taking down the bar.
Custom widgets
The widgets above are the ones the shell draws for itself. A custom entry points at a script instead: the file names itself with registerWidget, and widget_extensions maps that name to a local path.
{
"widget_extensions": {
"world-clock": "widgets/world-clock.js"
},
"bar_widgets": [
{ "type": "custom", "name": "world-clock",
"options": { "zone": "Asia/Tokyo" } }
]
}A custom widget takes the same place in bar_widgets and bar_items as any other — the only difference is that name is looked up in the manifest rather than in the built-in set, and options is handed to the script unchanged. A script runs inside the shell page and can do what the shell can, so it is local, user-authored code at the same trust level as a layout extension. docs/custom-widgets.md has the descriptor, the context a widget receives, the load and reload rules, and a worked example.
At runtime. config.bar_widgets on the control socket replaces the whole extra-widget list, in the file's own JSON:
viewport msg -t config.bar_widgets --widgets '[{"type":"disk","path":"/home"},{"type":"volume"}]'An empty array clears it back to the default bar. The status sampler is reconfigured for what the new list draws, so a widget taken off the bar stops costing samples — and an override in bar_items, as here, keeps its precedence over whatever is set.
Overriding the whole bar
bar_widgets adds to the shipped set, but it cannot move a widget into the middle of the modules or drop a module you do not want. bar_items replaces the entire right side of the bar with an explicit, ordered list, where each entry is either a module the bar already draws or a widget:
{
"bar_items": [
"net",
{ "type": "disk", "path": "/games" },
"clock",
{ "type": "weather", "location": "Pickering, ON, Canada" }
]
}A bare string names a built-in module — mode, tray, net, disk, cpu, load, memory or clock — and an object names a widget, taking exactly the same options as a bar_widgets entry — custom widgets included, their name coming from widget_extensions either way. The bar draws only what the list names, in the order given, so a widget can sit between the network and the clock, and a module you leave out does not appear. Present but empty draws no right side at all. Leave the key out entirely and the bar is the shipped default plus any bar_widgets.
bar_items supersedes bar_widgets when both are present: the override wins, and the widget list drives the same status sampling (mounts and volume) as the additions would have.
At runtime. config.bar_items on the control socket replaces the whole right side, in the file's own JSON:
viewport msg -t config.bar_items --items '["clock","net"]'An empty array draws an empty right side rather than changing nothing.
Interacting with the bar
Widgets are not passive — the bar is a web page, so the pointer already rests on it, and each widget turns that into a command the compositor runs on the host through shell.exec, the same spawn path a keybinding's exec uses.
volume— scrolling raises or lowers the default sink's volume in 5% steps; right-click toggles mute.mic— the same controls on the microphone: scrolling adjusts the default source's volume, right-click toggles its mute.
Those two go through status.volume rather than shell.exec: the compositor runs the same wpctl it samples with, waits for it, and re-samples — so the number on the bar is the new one immediately. Sending the command and asking for a refresh separately is a race the refresh wins, which showed as a volume that moved and a bar that did not until the next two-second tick.
disk— clicking opens the mount in the default file manager (xdg-open <path>), so for a terminal-first setup it drops you at the directory.weather— clicking opens the place in a browser.clock— clicking it opens the calendar under it, and clicking it again takes it down;shell calendaris the same thing from a key, for a desk with no pointer on the bar. See the next section for what the clock says and how to change it.net— the other built-in module that is not read-only: clicking it opens the Wi-Fi picker, the same oneMod4+Shift+nopens. Its tooltip names the network in use once the picker has been opened at least once — before that the compositor has not spoken to NetworkManager at all, so there is nothing truthful to say.
The other built-in modules (a bare string in bar_items) carry none of this — they are read-only. The workspace pills and the taskbar are: clicking a number switches to that workspace, clicking a title focuses that window.
Under bar: auto the bar is on screen only while Mod4 is held, so every click it receives arrives with that modifier down. The compositor declines its own Mod4 gestures — move, resize, pan — over anything the shell has drawn in front of the windows, so those clicks reach the bar rather than dragging what is behind it. The cost is the few pixels of a window that has been moved under the floating bar: grab it anywhere else.
The floating bar is glass: the compositor blurs the windows behind it, which is the only way a bar that is up only while Mod4 is held can show what is under it rather than an opaque strip. "bar_blur": false leaves it flat instead — the windows stay sharp and no framebuffer effect is drawn for it. The key does nothing to a docked or hidden bar, which have no windows behind them to blur.
At runtime. config.bar sets the mode and config.bar_blur the glass, without touching the file:
viewport msg -t config.bar --mode docked
viewport msg -t config.bar_blur --enabled false # a bare message togglesA bare config.bar_blur flips the switch, which is what a keybinding wants.
The clock, and the calendar under it
What the clock module says, and the month grid a click on it opens.
{
"clock": { "locale": "de-DE", "hour12": false }
}clock.locale is a BCP 47 language tag. It decides the month and weekday names, the order the date is written in, and the day the calendar's week starts on — which is not a property of the language: en-US starts its week on Sunday and en-GB on Monday. Absent is the locale the engine is running under, which is what LANG and the rest of the locale environment already say; there is no en-US written into the shell any more.
clock.hour12 chooses a twelve-hour clock with an AM/PM after it (true) or a twenty-four-hour one (false). Absent is whichever the locale writes, so a desk that only wants its own conventions sets locale and stops there. Note what that means for a session already running in en_US: the clock used to be twenty-four-hour for everybody and is now twelve-hour there, because that is what the locale writes. "clock": { "hour12": false } asks for the old one and leaves the names alone.
clock.format replaces the whole module with a strftime-style template, for when the shipped shape is not the wanted one:
{
"clock": { "locale": "ja-JP", "format": "%m月%d日 (%a) %H:%M" }
}A template is the whole module, leading glyph included — the shipped clock draws one and a template draws exactly what it says, which is how you ask for a clock without it. The conversions that name something still go through locale, so a template is a layout rather than a second place to write English:
%a %A | weekday, short and long |
%b %B (%h) | month, short and long |
%p %P | AM/PM as the locale writes it, upper and lower case — empty for a locale that writes none |
%c %x %X | the locale's own date-and-time, date, and time |
%Z %z | time zone name, and the offset as +0100 |
%d %e | day of the month, zero- and space-padded |
%m %y %Y %j | month number, two- and four-digit year, day of the year |
%H %k %I %l | hour, 24- and 12-hour, zero- and space-padded |
%M %S %s | minute, second, and seconds since the epoch |
%F %D %R %T | %Y-%m-%d, %m/%d/%y, %H:%M, %H:%M:%S |
%% %n %t | a percent sign, a newline, a tab |
Anything else is left in the string with its percent sign, so a typo shows up as %Q rather than quietly eating the character after it.
At runtime. config.clock on the control socket sets the locale and format without touching the file:
viewport msg -t config.clock --locale de-DEOnly the fields given change; naming one of them leaves the rest as they were.
The calendar. Clicking the clock opens a month grid under it — on the monitor whose clock was clicked, since the shell is one page across all of them. The arrows page a month at a time, today is marked, the days either side of the month are drawn dimmed so a week that straddles two of them still reads as a week, and the date written along the bottom is both a statement of what today is and the way back to it. Clicking the clock again, or anywhere outside the panel, takes it down; so does the bar going away under bar: auto. There is nothing to configure and nothing to enable: it inherits clock.locale for its month, its weekday headings and the day its week starts on.
A shell drawn by an engine with trimmed Intl data — a small-ICU build — falls back to English names and keeps drawing. A clock that went blank because a month name could not be looked up would be worse than one in the wrong language.
Reloading the shell while it runs
The shell is a web page, and the loop of working on one is editing a file and looking at the result. Two ways to close that loop without restarting the compositor — which would take the windows with it, and on DRM the screen.
The keybinding. reload — Mod4+Shift+c in the shipped config — reloads the page now, bypassing the engine's cache. Always available, nothing to turn on.
The watch. --watch-shell, or VIEWPORT_WATCH_SHELL=1, watches the directory the page was loaded from and reloads when a file in it changes, so saving is the reload. --watch-config, or VIEWPORT_WATCH_CONFIG=1 (or running with --watch-shell), watches the active configuration file and reloads its settings on save. Off by default: a reload throws the shell's state away, and an installed desktop's files do not change under it.
What is watched is the directory holding the file:// URL that was loaded — --url's, and the shipped shell's — and its subdirectories, four levels down. A shell served over HTTP is left alone: that is a dev server's job, and watching it would mean polling.
Changes are debounced by 200ms, and only files a browser would fetch count (.html, .css, .js, images, fonts). Both matter for the same reason: an editor saving one file writes a temporary beside it and renames it over the top, and vim leaves a .swp and a numeric probe file behind before a character is typed. Without the filter, opening a file would reload the desktop; without the debounce, a git checkout would reload it once per file.
Reloading resets shell state, so windows return via the view.added replay but workspace assignments do not survive.
User shell extensions
For modular user UI widgets and panels with surgical live hot-reload (no full-page reload and no lost windows), place extension folders containing an extension.json manifest under ~/.config/viewport/extensions/<id>/ and optionally configure the extensions block:
{
"extensions": {
"enabled": true,
"hot_reload": true,
"dirs": ["~/.config/viewport/extensions"],
"enable": [],
"disable": []
}
}hot_reload defaults to true: saving an extension's extension.json, script, or stylesheet triggers an extensions.changed event and cleanly unmounts and remounts only that extension in place. See docs/shell-extensions.md for the manifest schema, slots (bar-left, bar-center, bar-right, desktop, overlay), and the window.viewportExtensions JavaScript API.
Runtime — the shell renders display settings in HTML and drives the compositor over the same JSON channel it uses for window layout, and may register further bindings with bind.add. That layer is additive and expendable by design: keep exit and a terminal in the config file so they survive the shell being unreachable. Everything else — wallpaper, dock contents, theming — is pure shell state and never reaches the C side.
On NixOS the flake's module renders all of this for you:
programs.viewport = {
enable = true;
url = "http://localhost:3000";
terminal = "${pkgs.ghostty}/bin/ghostty";
# An external menu; absent is the built-in launcher.
menu = "${pkgs.wmenu}/bin/wmenu-run -i";
bindsOverride."Mod4+Shift+e" = "exit";
};bindsOverride rather than binds: the two behave as they do in the config file, so binds."Mod4+Shift+e" = "exit" would leave you with that one binding and nothing else.
Two options change what the module renders rather than what it writes:
programs.viewport = {
enable = true;
userConfig = true;
chromiumBinary = "${pkgs.google-chrome}/bin/google-chrome-stable";
};userConfig starts the session without --config, leaving the bootstrap tier to the user's own ~/.config/viewport/config.json — the mode for a config written elsewhere, a home-manager xdg.configFile say. --config names the one bootstrap file the compositor reads, so a generated one shadows the user's rather than merging with it; with userConfig the options above are not written, and a warning names any that are set alongside it. chromiumBinary applies to the chromium backend only, naming the browser it drives — see shell-backends.md.
Media keys
Bound by default, because a desktop where the play key does nothing is broken in a way no application can fix from its own side: the key never reaches it. XF86AudioPlay does not belong to the focused window — it belongs to whichever player is playing, which is what playerctl resolves over MPRIS. Volume and mute go to the sink through wpctl, since turning the volume down means the machine and not whatever happens to be playing, and the brightness keys go to brightnessctl.
The volume keys move the sink 5% a press and the brightness keys the backlight by the same, because a binding fires on press and does not repeat while the key is held. The result appears for 1.2 seconds on the active output, even when the bar is hidden; repeated presses update one panel and restart its deadline. data/config.example.json shows typed actions at 1% for anyone who wants a finer adjustment, and a binds_override entry replaces one of these without touching the rest. Brightness still uses brightnessctl; it is read after the change rather than guessed from the requested step.
Missing tools fail quietly per keypress rather than at startup, which is the right trade for a binding nobody may ever press. As with every default, naming any binds in the config replaces the whole set.
The key names are the ones xkb gives the keys themselves. The play/pause key is XF86AudioPlay: xkb maps it to [XF86AudioPlay, XF86AudioPause] and chords are matched on the unshifted keysym, so XF86AudioPause names the dedicated pause key (KEY_PAUSECD, rare on a keyboard) and not the one on the media row. wev prints what any key really sends.
Notification sounds
The compositor claims org.freedesktop.Notifications itself, so the sound a notification makes is configured here rather than in mako or dunst. There is no notification daemon left to configure.
{
"notifications": {
"sound_file": "/run/current-system/sw/share/sounds/…/message.oga",
"sound_name": "message-new-instant", // ignored when sound_file is set
"history": 50 // 0 keeps no record at all
}
}sound_file is a path, played as given. sound_name is a name from the sound naming specification, resolved against the installed sound theme — bell, message, complete, dialog-warning. A path always resolves and a name may resolve to nothing on a machine with a thin theme, so sound_file wins when both are set. Blanking a value is the same as leaving the key out.
Absent is silence, and there is deliberately no built-in default: the freedesktop sound theme every distribution installs has no notification event of its own, so a name chosen here would be one desktop's taste imposed on every other.
At runtime. config.notifications on the control socket sets the sound and the history without touching the file. The sound player is re-read, and a lowered history drops the oldest entries there and then:
viewport msg -t config.notifications --sound_file /sounds/notify.ogg --history 20Only the fields given change. Blanking the sound file is silence, the same as leaving the key out.
What a sender asks for wins. The specification gives programs three hints and all three are honoured. sound-file and sound-name mean the same as the config keys above and override them for that one notification, and suppress-sound silences it entirely — that hint means "I am playing my own", and a server that played anyway would make two sounds for one event. So the config setting is what a notification sounds like when the program sending it expressed no opinion, which is nearly all of them: notify-send sets none of these hints.
Playback is PipeWire directly — the same library the screencast portal streams through, so this costs the compositor no new dependency — with symphonia decoding the .oga and .wav a sound theme ships. The stream is described in the file's own rate and channel count and PipeWire converts, and it carries media.role = Notification so a session manager that ducks other audio for an alert can see what it is.
Each sound decodes and plays on a thread of its own, so a sender is never blocked for the length of one; decoded files are kept, because the same short sound plays for the life of the session. A session with no sound server plays nothing, says so once at startup, and drops sound from the capabilities it reports so a program that would have suppressed our sound in favour of its own knows to go ahead.
The sound_name lookup is the sound-theme search written out: $XDG_DATA_HOME and each $XDG_DATA_DIRS entry's sounds/, the theme in $XDG_SOUND_THEME (default freedesktop), its stereo/ profile before its flat directory, .oga before .ogg before .wav, and Inherits in each index.theme followed breadth-first with freedesktop as every theme's implicit parent.
The system tray
On unless a file turns it off. The compositor claims org.kde.StatusNotifierWatcher and a host name beside it, and forwards each registered item to the shell, which draws the icons on the bar — the same arrangement as notifications, and for the same reason.
{
"tray": true, // false: claim neither name, and draw nothing
"icon_theme": "Papirus" // searched before hicolor, which is always searched
}"tray": false is for a session that would rather run waybar's tray, or one that wants none at all. It takes effect on reload as well as at startup: the bus names are released, the bar empties, and applications see the tray go away exactly as they would if this program had exited. Turning it back on claims them again.
At runtime. config.tray flips the claim at once (a bare message toggles), and config.icon_theme changes the theme the icons resolve against:
viewport msg -t config.tray --enabled false
viewport msg -t config.icon_theme --theme BreezeA new icon theme empties the caches immediately, which is what installing icons and wanting to see them asks for.
Even with it on, a KDE session or a GNOME extension that already holds the watcher name keeps it — the name is queued for, never taken, and the log says which happened. What that means in practice is that running this beside another tray is not a conflict, it is a decision made by whichever started first.
icon_theme is the theme an item's icon name is resolved against. There is no way to ask a Wayland session what its icon theme is — GTK keeps it in dconf and Qt in an ini file, and neither is something a compositor should be reading — so it is named here. An item that ships its own icons and points at them with IconThemePath is searched there first, whatever this says, and applications that publish raw pixmaps rather than names need no theme at all.
Clicks: left activates, right opens the menu, middle is the secondary action, and the wheel scrolls — which is what a volume applet in a tray expects. An item that publishes a com.canonical.dbusmenu object has its menu read by the compositor and drawn by the shell, so it is styled by the same stylesheet as the rest of the desktop; one that implements ContextMenu instead is asked to draw its own window, as it would be under any other tray. Submenus open in place rather than flying out beside the menu — everything the shell draws over a window is one rectangle it has to name to the compositor, and a panel outside that rectangle would be drawn behind the window it is meant to be over. See docs/protocols.md.
Where the tray sits on the bar is the shell's business, like every other bar item: it is tray in bar_items, and it draws nothing at all when there is nothing registered.
The notification centre
On by default, keeping the last 50 notifications.
A notification is a popup and then it is nothing. One that arrived over a fullscreen game, or while the screens were blanked, or in the ninety seconds somebody was making coffee, was never seen and cannot be gone back to — which is what every desktop's notification centre is for, and what a second daemon is usually installed to keep. The compositor is already that daemon: it claims org.freedesktop.Notifications, so the only copy that ever existed was already in this process on its way to the shell.
Mod4+Shift+m opens the centre. It is drawn by the shell, so it is styled by the stylesheet already open in the editor, like the popups themselves. A row's ✕ forgets that notification, the footer forgets all of them, and a row whose application offered buttons still has them: pressing one tells the application exactly what pressing it on the popup would have.
Mod4+Shift+i toggles popup do-not-disturb. The notifications.dnd on|off shell command makes the state explicit for custom bindings or shell.command IPC. The manual choice is stored in the existing shell session. Fullscreen windows and active screencasts enable the same suppression automatically, without changing that manual choice. Existing popups are removed immediately; new notifications still enter history, and lifting suppression does not replay them. This affects popups only, not notification sounds.
A fullscreen window suppresses the popups on the monitor it covers, which is the one showing that workspace — the same scoping that decides where the bar goes. A video fullscreen on the second monitor leaves messages arriving on the first, and one left fullscreen on a workspace nobody is looking at suppresses nothing.
What stays and what goes:
| the popup timed out | kept — this is the case the centre exists for |
| dismissed with its ✕ | kept: the popup went, which is not the same as dealt with |
| an action was pressed | gone — a mail opened is not something to go back to |
| the application withdrew it | gone: it says the message is no longer true |
| forgotten from the centre | gone, and the application is not told |
The record is the compositor's rather than the shell's, and deliberately: the shell is a web page, restarted when it crashes and reloaded when its stylesheet changes, and a history kept there would be lost by both. It is memory only — nothing is written to disk, so a compositor that exits takes the list with it.
"history": 0 turns it off: popups are drawn and nothing is kept, which is what a session that would rather not hold a list of everything that notified it asks for. The setting applies on reload, and lowering it drops the oldest entries there and then rather than waiting for them to age out.
The clipboard history
On by default, keeping the last 25 things copied.
A Wayland selection is not a buffer anywhere: it is an offer from the client that owns it, and the data exists only while that client is running. Close the terminal you copied from and the clipboard is empty — which is why every desktop grows a clipboard manager, and why one is usually a second daemon holding a wlr-data-control connection open. The compositor is already that daemon: every selection on the session passes through it, so keeping the last few is reading what is already being offered.
{
"clipboard_history": 25 // 0 keeps nothing at all
}Mod4+Shift+v opens the picker, which the shell draws — so it is styled by the stylesheet already open in the editor, like the notifications. Choosing an entry puts it back on the clipboard with the compositor as the selection's owner, which is the whole point: the application that copied it may have exited hours ago. A row's ✕ forgets that entry and the footer forgets everything, which is what somebody asks for after copying a password.
Text only, and only the clipboard. Recording the primary selection would mean an entry for every word dragged over with a mouse, and images are megabytes each with nowhere to draw them in a list of lines. Entries are capped at 256 KiB — a clipboard holds what a person copied, and what a person copied fits on a screen.
"clipboard_history": 0 turns it off: nothing is read and nothing is kept, for a session that would rather run cliphist or one that does not want a copy of every password that passes through the clipboard. The setting applies on reload, and turning it off empties what was already there.
At runtime. config.clipboard_history sets how much the compositor keeps, with the same immediate effect:
viewport msg -t config.clipboard_history --limit 50Wi-Fi and Bluetooth
Mod4+Shift+n opens the Wi-Fi picker and Mod4+Shift+t the Bluetooth one; clicking the bar's net module opens the first as well. Both are drawn by the shell — so they are styled by the stylesheet already open in the editor, like the notifications — and both are answered by the compositor, because the page has no bus and NetworkManager and BlueZ are both on it.
There is nothing to configure and no daemon to add. Whatever already manages the machine's networking is what these talk to: a network joined here is a NetworkManager connection that nmcli and every other applet can see, and the passphrase goes into NetworkManager's own secret store rather than anywhere in this compositor.
Neither radio is touched until a picker is opened. Reading the access point list is several bus round trips per access point and a scan is the radio transmitting, so the compositor connects to NetworkManager on the first press and stops reading the moment the picker closes; the Bluetooth picker starts a discovery when it opens and stops it when it closes. A picker left open is a radio left scanning, which is why a click anywhere else takes both down.
In the Wi-Fi picker, a row is a network rather than an access point — a mesh publishing one name from three radios is one row — and clicking it does the obvious thing: leave the one in use, join one that is already saved or open, ask for a passphrase for one that is neither. The passphrase box is a real text field, and the shell asks the compositor for the keyboard while it is up (shell.focus) and hands it back to the window that had it afterwards. An enterprise network is named as one and not offered a box: it wants a certificate and an identity, which is nmcli work.
In the Bluetooth picker, tapping a device connects it — pairing and trusting first when it has never been paired, so it comes back on its own next time — and tapping a connected one disconnects it. The ✕ on a paired device forgets it, which is the way out of a pairing that went wrong.
Pairing needs an agent, which is the piece bluetoothctl makes you type agent on for. The compositor registers one the first time something is paired, with the NoInputNoOutput capability — there is no dialog here to show a six-digit code in — which is the mode every headset, mouse and speaker uses. It is deliberately not made the session's default agent: that would also answer incoming pairing requests, and answering those automatically is how a stranger pairs with your laptop. A device that insists on a displayed code cannot be paired from here; BlueZ says so and the picker shows what it said.
The on-screen keyboard
It is always available, the way the clipboard picker and the two radios above are — Mod4+Shift+k raises and lowers it by hand regardless of anything below, for a desk that has a keyboard already and wants to test it, or to type into something that never asked. What "osk" in the config file controls is only whether it also comes up on its own, when the focused client enables a zwp_text_input_v3 — the protocol's own way of saying a text field wants typing into — and goes back down when that stops being true.
"auto", the default, does that, but only once the seat has actually seen a touch device: a desk with just a keyboard and a mouse never has, so on one of those it behaves exactly like"manual"below without a config file having to say so. This is what a touch panel wants and a desktop with a hardware keyboard does not, without either one having to name itself — raising a keyboard nobody asked for on top of whatever is being typed into with a real one is the problem this exists to avoid."manual"never raises it on its own;Mod4+Shift+kis the only way it comes up. For a desk that would rather decide every time, or that hits the rare window a hardware keyboard cannot reach at all — a login prompt drawn before the session's own input method exists, say."off"does neither.Mod4+Shift+kis bound to nothing else while this is set, so pressing it does exactly nothing — a deliberate consequence of asking for the keyboard gone entirely, not a chord left unfinished. Changing the setting takes effect immediately on a reload, including hiding a keyboard that was already pinned open by hand.
It types by pressing keys, not by handing text to the client directly. This compositor has both paths wired up — a fork of smithay's zwp_text_input_v3/zwp_input_method_v2 machinery, with an escape hatch that lets the compositor stand in for a real input method, and inject_keysym, the same call remote-desktop keyboard injection already goes through — and it uses the second. commit_string only reaches a client that has bound text-input and enabled it, which every toolkit does for a real text field but a terminal emulator or a login prompt typically does not, so a keyboard that only worked that way would go silent on exactly the desks that most need one. Key presses reach anything with a keyboard, the ordinary way. See the doc comment on Request::OskKey in crates/viewport-ipc/src/request.rs for the whole of that reasoning, including how Shift and Caps Lock are made to work over a path that can only press keys rather than glyphs.
Held keys repeat the way a hardware key does — the seat's own repeat, from repeat_rate and repeat_delay above, and nothing timed by the keyboard itself — because a tap is pressed: true immediately followed by pressed: false, and a key held down is true once and false on release, exactly like a real one.
At runtime. config.osk sets the raising policy — auto, manual or off — with effect right away, including dropping a keyboard pinned open by hand:
viewport msg -t config.osk --mode offAnything else is refused.
Layer-surface rules
"layer_rules": [
{ "match": { "namespace": "panel" }, "opacity": 0.94, "blur": true },
{ "match": { "namespace": { "equals": "private-panel" } },
"capture": false },
{ "match": { "namespace": { "regex": "^(menu|wofi)$", "flags": "i" } },
"z_index": 10 }
]These rules match the namespace a wlr-layer-shell client supplies when it creates a surface. The matcher has the same forms as a rich window rule: a string is short for case-insensitive contains; an object names exactly one of contains, case-insensitive equals, or regex, with optional regex flags. Layer regexes use Rust regex syntax, not JavaScript: look-around and backreferences are unavailable, and the supported flags are i (case-insensitive), m (multi-line), s (dot matches newline), and y (anchored at the start). Malformed regexes, unsupported flags, unknown rule fields, ambiguous matcher objects and rules with no namespace are configuration errors rather than silently unmatched privacy rules. At most 256 rules and 64 KiB of matcher text are accepted, with 1 KiB per matcher and bounded compiled regex size, so a watched configuration cannot monopolise the compositor thread.
Every matching rule composes in file order. A rule replaces only the fields it explicitly names, and a later match wins for a field named by both. This differs from first-match window rules: it permits a broad panel default followed by a narrow exception without repeating opacity, blur and ordering policy. Defaults are opacity: 1, capture: true, blur: false and z_index: 0. An empty layer_rules array clears the set; omitting the key on reload leaves the current set alone, like every other patch-style configuration key.
opacity is the final alpha for the complete surface tree, including subsurfaces and popups, and must be between 0 and 1. capture: false leaves the physical display unchanged but replaces that tree's complete bounding rectangle, including popups, with opaque black in output, region and whole-desktop captures. Policy is resolved before a new layer is mapped and replaced atomically once a reload is accepted, so frame assembly cannot observe a mix of old and new policy. Removing or overriding it with capture: true allows capture again.
blur: true requests blur behind the complete surface tree. Nested and headless GLES sessions implement it with the same framebuffer effect exposed through ext-background-effect-v1. The current DRM/Vulkan renderer cannot copy its active frame into a sampleable image, so it neither draws rule blur nor advertises that protocol. The rule remains renderer-neutral rather than claiming a capability an output cannot provide.
z_index is a signed ordering override. Larger values are in front, but only among surfaces in the same protocol layer: no value can move background over bottom, top or overlay. Equal values retain the protocol map's stable newest-on-top order, and hit testing uses the same order as rendering. Reloading rules never unmaps, remaps, rearranges or reconfigures a client surface.
The session-lock path remains absolute. While locked, no ordinary layer surface is rendered or hit-tested regardless of opacity or z_index; only the lock surface (or fail-closed black) and pointer can appear.
Namespaces are client-chosen labels, not authenticated application identities. Rules are reliable policy for configured clients, but a hostile client can choose another namespace; do not treat a namespace match as a sandbox boundary.
At runtime. config.layer_rules replaces the set in the file's own JSON:
viewport msg -t config.layer_rules --rules '[]' # an empty array clears itThe set is compiled before anything changes, so one that does not compile leaves the old one standing.
Window rules
"rules": [
{ "app_id": "cs2", "workspace": 3 },
{ "app_id": "pavucontrol", "floating": true, "width": 600, "height": 400 },
{ "title": "Picture-in-Picture", "floating": true },
{ "match": { "app_id": { "equals": "foot" }, "tag": { "contains": "drop" } },
"workspace": "scratchpad", "width": 900, "height": 600 },
{ "match": { "title": { "regex": "^Picture.in.Picture$", "flags": "i" } },
"pinned": true, "width": 480, "height": 270 },
{ "match": { "app_id": { "equals": "foot" }, "workspace": 2 },
"pseudotile": true, "width": 900, "height": 600 },
{ "app_id": "foot", "swallow": true },
{ "app_id": "keep-terminal-visible", "swallow": false },
{ "app_id": "org.keepassxc.KeePassXC", "capture": false },
{ "app_id": "picture-in-picture", "opacity": 0.9 }
]Matched on app_id, or on title for applications that give every window the same app_id and differ only in what they show. Both are substring matches: an exact one would need the application's internal name known exactly. A rule is applied before the window is inserted anywhere, so it goes straight where it belongs rather than appearing in one place and jumping. Existing windows are also re-evaluated when their title, app ID or tag changes and when configuration is reloaded. A newly matching rule applies the actions it explicitly names; a rule that stops matching does not undo manual workspace or floating state. Capture is current permission rather than layout state, so removing a denial explicitly allows capture again. Opacity is also current policy: a non-negative number multiplies that window's global and layout opacity, and removing the rule restores the identity multiplier 1.
The legacy flat shape above remains supported. Rich rules put app_id, title and/or the stable xdg-toplevel tag under match; each field accepts contains, equals or regex (plus optional regex flags). All supplied fields must match. Rules still use first-match order. String field values are a short form of contains. match.workspace is a positive workspace number and matches the active workspace at the instant the window opens. It does not change the action named by the outer workspace field.
The matcher vocabulary is Hyprland's as well as this one's. class is the same string as app_id under its X11 name, and initial_class / initial_title are the values at map time — which is when a rule is resolved, so they are the same strings unless a window retitles itself before it is placed. xwayland is true for an X11 client under Xwayland, and modal for a dialog: a floating window with a parent, the same pair the compositor floats for. class, initial_class and initial_title take the same contains / equals / regex conditions as the fields above; xwayland and modal take a boolean, and a rule that names one is only matched when the window's answer agrees. content matches what the client declares through wp_content_type_v1 — "game", "video", "photo" or "none" ("image" is accepted for "photo"). Unlike the others it can change while the window is open, and the compositor re-sends view.props when it does, so a game that starts playing is matched then rather than only at map time. group takes a boolean and matches a window inside a tabbed or stacked container; like content it is re-evaluated as the window moves in and out of a group, not only at map time.
The effects this shell can apply are the workspace, floating and its rect, pinned, pseudotile, swallow, capture, opacity, focus, animation, keep_aspect_ratio, tearing, blur, idle_inhibit, confine_pointer, decorate, no_auto_hdr, tonemap and a size floor and ceiling. focus: false opens a window without taking the keyboard — a launcher, or a picture-in-picture window that should appear without interrupting. animation: false gives it the reduced-motion treatment: no fade, but it still appears. min_width / min_height raise the client's own floor and max_width / max_height cap it, all in logical pixels; zero or absent leaves the client's answer.
keep_aspect_ratio: true makes a floating window keep its width-to-height ratio when resized by hand — Hyprland's rule of the same name. The axis the hand moved more drives the resize and the other follows the ratio the window had before the step, so the ratio locks in at the first pull and stays put. It applies to the resize that changes a window's own rectangle (the floating resize, by Mod4+right-drag or the keyboard resize mode); a tiled window's resize is a share of its container, not a rectangle, so there is no ratio to keep there.
tonemap says what happens to a window whose content is brighter than the output can show — HDR content on an SDR screen, or on a dimmer HDR one. on (the default) folds everything above a knee into the headroom that is left, so mid-tones keep their slope and highlights keep their detail; limited does the same with an earlier knee, for a panel with less headroom; clamp scales the source peak onto the target's and clips what is left; off leaves the range to clip. Hyprland's values and Hyprland's default. Nothing moves on an SDR screen showing SDR content, because there the ratio of the two ranges is one.
no_auto_hdr: true keeps the window from switching its output into HDR when it is fullscreen — see Automatic HDR below. It is Hyprland's rule of the same name, for the same case: a terminal or a player that happens to be fullscreen should not relight the desk for content nobody asked to be shown in HDR.
tearing: true asks the compositor to present the window as soon as a frame is ready, the same as wp-tearing-control-v1 does when the client asks; it is granted only when the window covers its output and nothing is layered over it, and never while the session is locked or the overview is up. blur: true draws the framebuffer blur behind the window — the same effect a client gets from ext-background-effect-v1 — whether or not the window asked for it, so an opaque terminal over a blurred rule is glass rather than a rule the window opts out of. The whole surface tree is affected, popups included, so a menu over a blurred window blurs too; X11 windows do not, because their surfaces carry no per-surface effect metadata to hang the request on. Like Layer-surface rules, the effect is drawn only where the renderer can run it, and a session whose renderer cannot draws the window sharp rather than failing the rule. idle_inhibit: true keeps the session awake for as long as the window is mapped, beside the protocol and org.freedesktop.ScreenSaver inhibitors the compositor already honours. decorate: false hands this window's frame to the client — the same answer the global "decorations": "client" gives, but for one window — and decorate: true keeps the compositor's frame even when the global policy is client-side. Removing the rule hands the decision back to the global policy.
confine_pointer: true holds the pointer inside the window while it is focused — Hyprland's rule of the same name, for keeping a game's cursor on its monitor without the client asking for a constraint of its own. Motion that would leave the window is clamped to its edge instead. A client that negotiates its own pointer lock still wins: the rule confining the cursor is not leave to override a lock the client asked for. Unfocusing the window, or removing the rule, releases the pointer.
{ "content": "game", "fullscreen": true, "confine_pointer": true }Rules may be named for runtime control. A rule with a name field can be toggled from a keybinding or from the socket:
{ "name": "my-pip", "title": "Picture-in-Picture",
"floating": true, "pinned": true, "width": 480, "height": 270 }viewport msg -t shell.command --command rule.toggle --args my-piprule.toggle flips the named rule on and off; rule.enable and rule.disable set it explicitly. All existing windows are re-evaluated when a rule is toggled, so a window that was floating under a disabled rule returns to tiling and vice versa. Named rules without a name field are always active. A rule that is not in the current config file but was previously disabled is harmlessly ignored.
workspace: "scratchpad" opens a floating window hidden. scratchpad.toggle shows or hides it as an overlay on the active output and scratchpad.move sends the focused window there. pinned: true makes a window floating and keeps it on its assigned output across numbered workspace switches; window.pin.toggle changes that state. Scratchpad and pinned windows do not appear in overview or participate in canvas placement.
workspace: "special:NAME" is Hyprland's named special, and the scratchpad is just the one called scratchpad — the bare spelling above is kept because it is what every existing config and chord says. A window ruled onto a named special starts hidden, and it is toggled by name:
viewport msg -t shell.command --command special.toggle --args notes
viewport msg -t shell.command --command special.move --args notesspecial.toggle NAME shows or hides that space as an overlay on the active output; with no argument it does nothing, because a name is the whole point. special.move NAME sends the focused window there, hidden like the scratchpad. Named specials are saved in session.json with the window, so a restart brings them back where they were — still hidden until toggled, and still on the output they were shown on.
pseudotile: true reserves the ordinary full tiled slot but centres the client at the rule's width and height, or its natural size where either is absent. The client is capped by the slot. Pseudotiling is ignored while a window is floating, special, fullscreen, or shown by a non-tree layout; its state and optional dimensions survive dynamic rearrangement, layout switches and session restore. shell window.pseudotile.toggle changes the focused tiled window.
swallow: true allows an ordinary tiled parent to be replaced by a descendant process's ordinary tiled window. A matching child rule with swallow: false opts out. This uses kernel process credentials plus start-time-verified process ancestry for native Wayland clients, never focus or launch timing. IPC carries only proven ancestor view IDs, not process IDs. X11 _NET_WM_PID is client-supplied and therefore is not accepted as proof. Closing the child puts the parent back in the same leaf; moving, floating, fullscreening, specialising, or closing either side dissolves the relation safely.
capture: false replaces that window, its native popups, related X11 popup windows and its shell frame with opaque black in screenshots and screen shares. Direct window captures stay alive at their original size but return black; the portal does not offer that window as a source or restore it from an old token. The physical display is not changed. Shell metadata elsewhere, such as a taskbar label, is outside the window and is not hidden. Capture is allowed by default, and a non-boolean value is ignored.
The compositor passes the rules to the shell. Layout actions remain shell decisions. Capture denials are also matched conservatively in the compositor, so privacy fails closed while the shell is starting and again if the shell is lost: losing a shell makes the compositor forget the answers that shell gave and fall back to this conservative match until a shell speaks for each window again. An explicit view.capture — the shell's reply, or one sent by hand with viewport msg -t view.capture — stands until the next one, so a later title, app ID or tag change does not re-derive a denial over a grant.
At runtime. config.rules replaces the whole set in the file's own JSON:
viewport msg -t config.rules --value '[{"app_id":"firefox","capture":false}]'An empty array clears it. A window still awaiting its resolved capture answer is tightened the way a reload tightens it; one that already carries an explicit answer keeps it.
Groups
A tabbed or stacked container is a group: one window on screen, the rest behind a strip of titles. Mod4+w and Mod4+s make one out of the container the focused window is in.
{
"group": {
"auto_group": true,
"drag_into_group": true,
"merge_groups_on_drag": true,
"group_on_movetoworkspace": false
}
}auto_group decides what happens when a window opens from inside a group. Absent keeps the behaviour this has always had — the new window joins when the group's axis matches the pending split and splits beside it otherwise. true always joins, so Mod4+Return in a tabbed container adds another tab; false always splits beside the group, which is Hyprland's default.
group.lock from a binding or the socket locks the focused container against new windows; the same command unlocks it:
viewport msg -t shell.command --command group.lockA locked group refuses a new window even when auto_group is on, which is Hyprland's deny_from_group said once for the whole container. Nothing happens on a plain split, which has no tabs to protect. The lock is not saved across a reload: it is a property of the container, and the tree is rebuilt from the session file.
The three drag rules are Hyprland's, with its defaults:
drag_into_group(on): a window dragged over a group and released becomes one of its tabs instead of staying floating on top of it. A locked group refuses, exactly as it does forauto_group.merge_groups_on_drag(on): dragging a group by its tab strip and dropping it on another group merges the two — the dragged group's windows are appended to the target's tabs and its container goes away. Clicking a tab still selects it; only a hand that moves merges anything.group_on_movetoworkspace(off): moving a window to another workspace joins it to that workspace's solitary unlocked group. "Solitary" is counted in windows on display, not in the tree: a group showing one tab is one window, so a moved window can join it and a workspace holding a split of two windows cannot.
The tab strip is the groupbar: it is drawn by the shell, shows every member's title, and is what a group is dragged by. There is no separate floating bar and nothing compositor-side to configure.
At runtime. config.group sets auto_group without touching the file:
viewport msg -t config.group --auto_group trueLayout models
"layout" in the config file picks which one the shell runs.
tiling — i3 and sway. Windows split the space they are given; containers can be split, tabbed or stacked. Mod4+w and Mod4+s set the last two, Mod4+e returns to a split. Tabs are the one place this shell draws a window title, because a collapsed tab cannot be identified without one.
scrolling — niri. A workspace is an endless horizontal strip of columns; each column holds one or more windows stacked vertically, and columns keep the width they were given, so opening a window never reflows what is already there. The view scrolls the minimum needed to keep the focused column on screen.
| Key | Scrolling layout |
|---|---|
Mod4+h / Mod4+l | focus the column left / right |
Mod4+j / Mod4+k | focus within the column |
Mod4+Shift+h/l | move the column along the strip, or to the next monitor at its end |
Mod4+comma / Mod4+period | consume the next window into this column / expel it back out |
Mod4+r | cycle the column width (⅓, ½, ⅔, full) |
Mod4+right-drag, or dragging a column edge | set the column width freely |
Mod4+Shift+r | cycle the window's share of the column height |
Mod4+Home / Mod4+End | jump to either end of the strip |
Mod4+Tab / Mod4+Shift+Tab | step through every window on the strip, wrapping at its ends — including the columns scrolled out of view |
| three-finger swipe ←→ | scroll the strip under your fingers |
| three-finger swipe ↑↓ | previous / next workspace |
Column widths are fractions of the space a window may occupy — the tiling area minus its padding — and the dividers between columns come out of those fractions rather than being added on top. Both details matter: measured against the padded box a full-width column is two gaps too wide and runs off the right edge, and with dividers added on top two half-width columns plus the divider between them are wider than the screen, so moving focus from one to the other scrolls the strip and everything visibly shifts. Taking the (N-1) dividers out of N columns makes fractions summing to 1 fill the width exactly.
Resizing means changing a column's own width. Columns do not share space, so widening one takes nothing from its neighbours — it makes the strip longer and shifts everything after it along. Nothing you are not touching changes size, which is the point of the model and the one place it will surprise a sway user. Vertical resizing inside a column works the ordinary way, since windows stacked in a column do share it.
Directional focus moves to the shell in this mode: the compositor decides direction from where windows are on screen, and the column you are reaching for is usually scrolled off it.
solar — the focused window in the middle at 60% of the screen, the rest in orbit around it: eight warm slots in the margin at full size, and everything after that pushed to the edges and corners, drawn at 40% and dimmed. Focus is what makes a window the middle one, so the window being typed into is never shrunk, dimmed or covered. Two monitors run either as two independent systems or with the second holding the first's background applications.
| Key | Solar layout |
|---|---|
Mod4+h/j/k/l | focus by casting a ray from the middle window |
Mod4+bracketleft / Mod4+bracketright | rotate which window is in which slot |
Mod4+Shift+s | throw the focused window at the other monitor, where it lands in the middle |
Mod4+equal / Mod4+minus | grow / shrink the middle window |
Mod4+Shift+g | two independent systems, or one plus a field of background applications |
It has no resize mode and no dividers: a satellite's size is a function of the middle window's, so growing that one is the only dimension the layout has. The full model, its formulas and its tunables are in solar.md.
matrix — the focused window at 60% of the width on the left, and the rest of your focus history halving away down the right: the window you were in before this one takes half the column, the one before that a quarter, and so on until a slot would be shorter than 100px. Everything past that point is stacked in the last slot with a count badge, most recently used on top.
The order is Alt+Tab order, so nothing is ever laid out by where it happens to sit in the tree — the window you keep returning to keeps a large slot, and the one you have not touched since this morning sinks to the stack. Focusing a window promotes it to the primary and pushes the one it displaced to the top of the column.
It has no keys of its own and no resize mode: focus is the only input the model takes, so Mod4+h/j/k/l, Mod4+Tab and clicking a window are the whole interaction. Its ratios are in matrix.md.
canvas — every workspace an unbounded plane. Windows sit at coordinates you gave them and keep them; the view pans and zooms over the top. Nothing an already-placed window does moves any other, opening one never reflows what is open, and zooming out draws windows smaller without resizing them — no client is asked to relayout itself for any view change.
| Key | Canvas layout |
|---|---|
Mod4+bracketleft / Mod4+bracketright | pan left / right |
Mod4+Prior / Mod4+Next | pan up / down |
Mod4+minus / Mod4+equal | zoom out / in |
Mod4+Shift+f | fit the whole plane on screen |
Mod4+Home | back to 1:1 on the focused window |
Mod4+r | size the focused window to the screen, less the gaps, without fullscreen |
Mod4+Shift+h/j/k/l | move the focused window across the plane |
Mod4+Tab / Mod4+Shift+Tab | step through every window on the plane, panning the view onto each — including the ones parked out of sight |
Mod4 + left drag | move a window, or pan the plane when the drag starts on the desktop |
Mod4 + right drag | resize a window, from the corner nearest where the drag started |
Zoom stops at 1:1 because past it the compositor would be enlarging a buffer the client painted smaller, and the way round that is to reconfigure every client on every step — the resize storm the layout exists to avoid. Zooming out is unrestricted and fully usable, pointer included. The whole model is in canvas.md.
All five models share one tree — the strip's columns and the orbits' order are both the workspace root's children — so switching layout and reloading rearranges what is open rather than discarding it. shell layout.model switches at runtime, with a name or with no argument to cycle:
"binds_override": { "Mod4+Shift+m": "shell layout.model" }Adding a sixth model is docs/layout-extension.md.
At runtime. config.layout picks the model without touching the file, and config.layout_extensions replaces the user script registry — the resolved list, not the file's paths:
viewport msg -t config.layout --layout scrolling
viewport msg -t config.layout_extensions --extensions '[{"name":"mine","url":"file:///mine.js"}]'An unknown name is refused rather than matching no model; clearing the registry under a layout that names one of its scripts falls back to tiling, as a reload faced with a typo does.
Dynamic tiling arrangements
"layout": "tiling" builds a tree of splits: a window opens beside the focused one, and the shape is whatever the splits you made say it is. That is the default and it is called manual.
"tiling_mode": "master-stack"replaces the manual part with an arrangement derived from which windows are open, so opening one rearranges what is already there.
| Mode | What it does |
|---|---|
manual | the tree of splits you make. The default |
master-stack | the first window takes one side, the rest share a column beside it |
spiral | each window takes half of what is left, turning ninety degrees every time |
bsp | the same nest, but each cut goes along the region's longer side, so nothing is driven to a silly shape |
grid | every window the same size, in rows. Four come out 2x2 on an ordinary screen, nine 3x3, and the row count follows the shape of the monitor |
Mod4+Shift+h and Mod4+Shift+l reorder rather than resplit, so promoting a window to master is moving it to the front — there is no separate command for it. layout.mode switches at runtime, with a name or with no argument to cycle:
"binds_override": { "Mod4+space": "shell layout.mode" }These are arrangements, not new kinds of tree. What comes out is the same node structure the manual mode builds, so resizing, moving, tabbed containers, the overview and the saved session all keep working — a dynamic mode is a rule for what the tree should be, applied when the set of windows changes.
That last part is the one thing to know: resize weights are reset whenever the arrangement is rebuilt, which is whenever the shape it asks for differs from the shape that is there — a window opening or closing, mostly, and also a monitor rotating under bsp or grid, both of which read the shape of the screen: one cuts along whichever side is longer, the other picks the row count whose cells come out closest to square. Every dynamic tiler behaves this way, and it is why manual is still the default.
None of this touches "layout": "scrolling", "layout": "solar", "layout": "matrix" or "layout": "canvas", each of which is its own model. Solar and the matrix in particular have no sub-arrangements: where a window goes is decided by its position in the order and nothing else — and on the canvas by nothing but where you put it.
At runtime. config.tiling_mode picks the arrangement without touching the file. It takes effect the same way layout.mode does — on the next change of the window set, not instantly:
viewport msg -t config.tiling_mode --mode bspAn unknown mode is refused here rather than silently leaving the tree manual, which is what the file's typo does (the file can only warn).
Focus at the edge of a monitor
Mod4+h and Mod4+l step focus left and right, and by default running out of windows on one monitor carries on to the next one — sway's behaviour, and what this has always done.
"focus_crosses_outputs": falseturns that off, so the edge of a monitor is where directional focus stops. It is worth having on a wide pair of screens, where the rightmost window on the left monitor is one keypress away from putting focus somewhere you were not looking.
It covers Mod4+j and Mod4+k too. Vertical focus falls off the end the same way, and a setting that held for two of the four directions would be a different surprise rather than a fix.
Both layouts honour it, but neither owns it. Tiling asks the compositor, which works out direction from where windows are on screen; the scrolling layout asks the shell, because the column being reached for is usually scrolled off screen. So the setting travels to the shell with the rest of the config, and false stops both — otherwise the same keypress would cross in one layout and not the other.
At runtime. config.focus_crosses_outputs flips it without touching the file. A bare message toggles:
viewport msg -t config.focus_crosses_outputs --enabled falseWhat it does not touch is asking for a monitor by name. A binding on shell output.focus right still moves there: the setting is about falling off the end of one screen, not about ever leaving it.
Pixel format
How many bits per colour channel the buffers that reach the screen carry.
"pixel_format": "10"--pixel-format 10 and VIEWPORT_PIXEL_FORMAT=10 say the same thing; the flag wins over the variable, and the variable over the file. 8, 10 and auto are the values, and 8bit / 10-bit are accepted for whoever types them.
| Value | What it asks for |
|---|---|
auto | Ten bits where the display takes it, eight where it does not. The default, and what every release before this one did |
10 | Ten bits and nothing else — an output whose plane will not take a ten-bit format does not come up |
8 | Eight bits, whatever the display can do |
10 is deliberately unforgiving. It exists to answer "am I actually getting ten bits", which auto cannot: auto falls back silently, so a display quietly serving eight bits looks exactly like one serving ten. A dark screen is the answer, and so is the line each output logs as it comes up:
DP-1: 2560x1440 at x=0, Abgr2101010That format is what the display agreed to, not what was asked for, so it is worth reading even under auto.
Eight bits is worth choosing for the opposite reason: a ten-bit buffer is wider, so it costs more bandwidth to scan out and more memory to composite, and on a display that only shows eight of the bits that cost buys nothing. HDR needs more than eight bits per channel, though, so "pixel_format": "8" and an output's hdr are working against each other.
Graphics cards
Every card on the seat is opened. Each one drives the monitors wired to it, draws them with a renderer of its own, and offers its own non-desktop connectors for lease, so a monitor on the discrete card of a hybrid laptop is a monitor rather than a connector nothing ever sees. Nothing here needs to be set for that to happen.
Two things are a preference rather than something the compositor can read off the hardware, and those are the two keys.
Which card is primary
"gpu": "card1"--gpu card1 and VIEWPORT_GPU=card1 say the same thing; the flag wins over the variable, and the variable over the file. The value is matched as a substring of the device path, so card1, renderD129 and a whole /dev/dri/by-path/pci-0000:03:00.0-card all work — nobody remembers which form a particular machine calls its cards, and the useful ones are not interchangeable between reboots.
The primary is the card the shell draws on, the one the default linux-dmabuf advertisement names, and — on a machine with one card — everything. It is not "the only card that is used": the others are opened regardless and drive their own screens.
Absent, the compositor ranks the cards itself: one that a Vulkan device actually exposes first, then whatever the seat calls primary. That ranking is right on a virtual machine, where the firmware's VGA device has a display and no Vulkan, and cannot decide anything on a hybrid laptop — the integrated GPU is the battery answer and the discrete one is the frames answer, and only you know which you wanted. A value that matches no card is a warning naming every card there was to choose from, and the ranking runs as though nothing had been asked.
The log says what happened, always, when there was a choice to make:
2 GPUs (/dev/dri/card0, /dev/dri/card1); drawing and scanning out on card1 as VIEWPORT_GPU asked
driving 2 GPUs — 0: /dev/dri/card1 (render /dev/dri/renderD129), 1: /dev/dri/card0 (render /dev/dri/renderD128)What clients may allocate
"cross_gpu": "portable"--cross-gpu portable and VIEWPORT_CROSS_GPU=portable say the same thing, with the same precedence. native and portable are the values, and native is the default. On a machine with one card this setting does nothing at all.
A client is told which card to allocate its buffers for, and which formats and modifiers that card can read. There are two answers to give it and the protocol has room for both:
- Per surface, once a window is on a screen: the card actually displaying it. This is always sent and it is the mechanism that makes two cards work. A client that honours it — everything on Mesa does — reallocates when its window is dragged to a monitor on the other card, and nothing else is needed.
- By default, before a window has been anywhere: one card, because the protocol's default tranche is one device. That card is the primary. What
cross_gpuchooses is which of its formats are named.
| Value | What is advertised by default |
|---|---|
native | Every format and modifier the primary's renderer can import. The default, and the fast answer: a window that stays on the card it was opened on keeps the tiled and compressed modifiers that are the whole reason modifiers exist |
portable | Only the formats every card on the seat can import. The window can move to any monitor without reallocating, and every client pays for it whether or not its windows ever move — what survives the intersection is usually linear, so a fullscreen window may lose framebuffer compression |
What goes wrong without portable, and how you would know. A client that ignores per-surface feedback keeps allocating for the primary. Drag its window to a monitor on the other card and the buffer arrives at a renderer that cannot read its modifier. The compositor copies it: the buffer is imported on a card that takes it, drawn into a buffer allocated on the scanout card in a format it can read, and that copy is shown — once per buffer, cached for as long as the client keeps it, so the cost is a blit per buffer and not a blit per frame. The compositor says so, once, naming the format and both cards:
a client buffer (Argb8888, modifier 0x100000000000006) imports on gpu [0] and not on
gpu [1]; the screens on the cards that refused it will show a copy, which costs a
blit per buffer. Set cross_gpu = "portable" to advertise only what every card can readOnce per format, modifier and card, not once per frame — so a line like that in the log is one condition and not one frame. portable is still the fix: the copy is the mitigation for the client that ignores its feedback, and it costs memory and a blit that a client following the protocol never pays. If even the copy cannot be made — no helper card takes the buffer, or the two cards share no renderable format and the CPU readback fails too — the surface is missing from that one screen, and a second warning says so.
A buffer no card can read is a different thing: the client is told the import failed, which over linux-dmabuf is a protocol error, because the alternative is a window that never appears anywhere with nothing said about why.
Outputs
The outputs block is keyed by connector name — DP-1, HDMI-A-1, what wlr-randr prints — and says how that screen should be brought up.
"outputs": {
"DP-1": { "mode": "2560x1440@240", "vrr": "game-or-video" },
"HDMI-A-1": { "mode": "2560x1440@240", "mirror": "DP-1", "vrr": "off" },
"DP-3": { "max_refresh": true, "transform": "90" }
}| Key | Meaning |
|---|---|
mode | "WIDTHxHEIGHT" or "WIDTHxHEIGHT@RATE". A string, always: "mode": 5 reads back as absent rather than being rounded into something |
max_refresh | The fastest mode at the largest size the display offers |
enabled | false leaves the screen off. Absent leaves it as it is, which is what every block written before this key existed means. The last output on cannot be turned off — a session with every screen dark is not one you can point at anything to fix |
scale, transform, hdr, x, y | As the same names elsewhere |
mirror | Source connector to scan out. Sink remains a physical head but owns no workspace/input rectangle. Same GPU, transformed mode and scale required in the first implementation; no self mirrors, missing source, chains or cycles |
vrr | off, always, fullscreen, or game-or-video, per physical output. game-or-video follows committed wp_content_type_v1 Game/Video and stays off when unavailable |
icc | Path to an ICC profile to read this monitor's colour from. A relative path is beside the config file. Two things are read: the vcgt tag — the table a profiler stored for the video card — applied as a gamma ramp under whatever a night-light client asks for, and the display's colour transform: sRGB in, what this monitor needs out, baked into a cube. A matrix-and-curve profile (rXYZ/gXYZ/bXYZ plus rTRC/gTRC/bTRC) is read backwards; a LUT profile is read forwards through its PCS-to-device tag — B2D1 (v4 float) first, then B2A1, then B2A0 — of the mft1, mft2, mBA or mpet type, and a LUT profile that carries only device-to-PCS tables (A2B1/A2B0/A2B2, D2B1, of the mft1, mft2, mAB or mpet type) is inverted at bake time instead, a PCS that falls outside the device gamut clamped to its boundary. Both XYZ and Lab PCS are read, at 8-bit v2, 16-bit v2 and v4, and in mpet's float. The matrix description wins when a profile carries both. The cube is uploaded and sampled by the Vulkan renderer after the parametric conversion, so the output is drawn in the panel's own space; on GLES and for YCbCr video the parametric conversion is used instead. A profile that cannot be read whole or inverted — a non-RGB device space, a corrupt tag, a non-invertible curve, matrix or CLUT — is not transformed at all, and the log names the rule that refused it |
The older global adaptive_sync boolean remains supported. false is the default off, true is always, and an output's vrr overrides that default. The settings panel exposes physical heads, including disabled and mirror sinks, while desktops and workspaces are created only for independent/source heads.
Automatic HDR
"render": { "cm_auto_hdr": 1 }render:cm_auto_hdr is Hyprland's name and meaning: 0 never switch on its own, 1 (the default) switch the output into HDR while a fullscreen window says its content is HDR, and 2 the same with the display's EDID primaries. This compositor draws HDR as BT.2020 whatever the EDID says, so 2 behaves as 1 and says so in the log when it switches. A value outside 0–2 takes the nearest of the three and warns.
The switch is undone when the window leaves fullscreen or closes — but only if this code made it: a monitor put into HDR by hand, through outputs.<name>.hdr or output.hdr, stays there. A window with a no_auto_hdr rule never causes a switch, a display whose connector does not offer BT.2020 with PQ metadata is left alone, and so is an output that is already in HDR for its own reasons.
What counts as HDR is the buffer's declared transfer function: PQ or HLG, which a client states through wp_color_management_v1 or one of the Windows descriptions the compositor offers. It is read from the whole surface tree, not just the toplevel, because that is where a client's real content can be: Wine's Wayland driver puts a Vulkan swapchain on a subsurface, so a game under Proton declares its HDR10 buffer on a child while its window surface stays sRGB. Wide primaries with an sRGB curve are wide-gamut SDR and do not relight the screen. The check runs when a window's fullscreen state changes, when a surface's declared description changes — a game that enters fullscreen first and enables HDR from its options afterwards is exactly that case — and once more on every configuration reload.
Turning colour management off
"render": { "cm_enabled": false }render:cm_enabled is Hyprland's master switch for the whole pipeline. Off means the wp_color_management_v1 global is not advertised, every client is taken as sRGB, every output is driven as sRGB, HDR is neither offered nor kept on, and an ICC profile's transform is not applied — its calibration ramp still is, because that is a KMS gamma ramp rather than part of the pipeline.
Like Hyprland's option it takes effect at the next start: a Wayland global cannot be taken back from clients that already bound it. A reload that changes it says so in the log rather than pretending the setting did nothing.
What SDR content is assumed to be
"render": { "cm_sdr_eotf": "gamma22" }render:cm_sdr_eotf is Hyprland's name for the other half of the same question. A window's buffers are converted from whatever the client says they contain into the output's space; a client that says nothing is assumed to be sRGB. default (the default) and srgb are that assumption, gamma22 takes an undeclared buffer as a pure 2.2 power curve instead, and gamma22force takes declared sRGB that way too — for capture stacks and drivers that write a pure power curve into a buffer they label sRGB. An unknown name keeps the default and says so in the log.
An output with an ICC profile always assumes sRGB, whatever this key says: the profile's cube maps sRGB into that panel, and feeding it a different curve would apply the profile to the wrong input. The assumption is stamped on a surface's buffers each time they are imported, so a reload applies from each window's next commit rather than to pictures already on screen.
Two cards can offer the same connector name. Connector names are handed out per card, so a laptop with an integrated display controller and a discrete card beside it has two DP-1s, and a key in this block would otherwise apply to both. The first card to claim a name keeps it — on a machine with one card that is every screen, and nothing written for one is affected — and the second gets the card index appended: DP-1-gpu1. That is the name in this block, in wlr-randr, and in output.layout, and the log says when it happened:
gpu 1: another card already has a screen called DP-1; this one is DP-1-gpu1The index is the card's position in the list the log prints at startup, and it is only as stable as the order the seat enumerates cards in. Where that matters, gpu above fixes which card is first.
A preferred mode is often not the fastest one. A 240Hz panel commonly advertises 120Hz as preferred, and a compositor that takes the display's word for it runs at half the rate the monitor was bought for — which is what this one did until these keys were honoured. "max_refresh": true is the short way to say "as fast as it goes"; mode with a rate is the exact way.
The rate is matched to the nearest whole hertz, because the kernel reports 239765 millihertz where a person writes 240. A size that exists at no such rate uses the fastest mode of that size and says so in the log — the resolution is the part you can see.
A monitor that comes back goes back where it was. A connector reappearing — a display waking from its own standby, a cable replugged, a KVM switching over — is a brand new output to the scan that finds it: it would be mapped to the right of everything else, in whatever order the connectors are enumerated, turned the way it left the factory. Two identical panels switched off overnight therefore came back swapped, and a rotated one came back landscape.
So the position, rotation, scale and mode of every output are remembered by connector name, and put back after each scan. What is remembered is what was asked for — by this block, by output.configure, or by wlr-output-management, which is what wlr-randr and a settings app's display panel use — and the last of those wins, so moving a monitor with any of them is not undone by the next unplug. This block is applied after the restore, so a position written here still has the final say — and settings.json's copy of it is applied after that, so a monitor arranged from the settings panel and saved is the last word of all. A save writes an outputs entry only for the monitors something has actually configured this session; saving every head would freeze whatever mode the backend picked for a screen nobody has an opinion about, and would leave this block permanently shadowed by an overlay that only restates it. A mode is only restored if the display advertises it, since the connector is the only identity there is and what comes back on a port need not be the panel that left it.
X11 applications on a HiDPI screen
The outputs block's scale is honoured for Wayland clients, and X11 clients are left at 1x: an X window's pixels are logical pixels, and the compositor magnifies them onto the panel. The window ends up the size it should be and blurry, which is what an X11 application does on every compositor that has not been patched for it.
xwayland.scale changes that, for the toolkits that can follow.
"xwayland": {
"scale": 2
}| Value | What it does |
|---|---|
"off" | X11 clients stay at 1x. The default, and what every release before this one did |
"auto" | Takes the largest scale of the monitors — a 2x panel beside a 1x monitor gives 2 |
| a whole number | That scale, whatever the monitors say. 1 means the same as "off" |
A fractional number is refused rather than rounded, because the only thing X11 has to carry a scale with is an integer window-scaling factor: 1.5 would silently become 2. "auto" rounds a fractional output scale for the same reason — 1.5 becomes 2, 1.25 becomes 1.
It does not reach every application. GTK 3, GTK 4, Qt 6 and Chromium (so also Electron) follow it and come out sharp at the right size. Qt 5 needs QT_AUTO_SCREEN_SCALE_FACTOR in its own environment, which the compositor deliberately does not set. Everything with no notion of a scale factor — xterm, SDL and GLFW games, Java/AWT, Tk — comes out sharp and half the size at 2, because the X screen now has twice the pixels and those applications still draw the same number of them. That trade is the reason the default is off; docs/protocols.md has the full account of why it is the trade, and what else was tried.
It is read once, when Xwayland starts. Reloading the config file moves the value and nothing on screen: the X screen's size in X pixels is settled when the server comes up, and X11 has no graceful way to resize the root window under a running client. Plugging a monitor in later does not change it either. Changing this means restarting the session.
The cursor is scaled with it — Xwayland is started with XCURSOR_SIZE multiplied by the scale, since an X cursor is loaded in X pixels and would otherwise be half the size on screen. cursor.size is still the size you see.