Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hint Assignment

The hints module (daemon-wm/src/hints.rs) gives every window a badge: every key that selects it. Typing a key narrows the picker to that key’s family, and the switcher’s own cycling then moves within it, so one key and the usual Alt+Tab motion reach any window of an application however many are open. The same key launches the application when no window of it is open (focus-or-launch), and ? in the picker reveals those launches as rows of their own.

Badges and Keys

One map binds keys to applications: the static bindings (Key Bindings: configuration over the compiled defaults, roles resolved) and the dynamic keys below. A window’s badge is every key whose binding covers its application (hints::badges), and a key selects exactly the windows its binding covers (hints::members). So every key a badge shows selects that window, and every key that selects a window is on its badge. An application bound to more than one key shows them all: with the web-browser role resolved to Edge, Edge windows show EW, and e and w each narrow to them. Each alias spends a key that no other application can have.

Dynamic Keys

An application no static binding covers gets a dynamic key when daemon-wm first sees it open (hints::KeyRegistry), and keeps it until its last window closes:

  1. Every enabled static key is reserved, whether or not its application is open; a key turned off (enabled = false) is free.
  2. Applications are keyed in the order they were first seen open (winlist::OpenOrder, kept from every window list poll); applications first seen in the same poll, such as at daemon start, in name order.
  3. Each takes the first letter of its name (the last reverse-DNS segment, lowercased) that is neither reserved nor held by an application opened before it: its initial, else its next free letter. Without one, it takes the first free hint_keys key; without one, it has no key, shows ·, and is reached by cycling.
  4. A key held is never taken by an application opened later, whatever opens or closes around it. A configuration that comes to bind the key or the application takes it back.

With no static f or b, foo and bar opened take f and b; fizz and buzz opened next take i and u; bop and fop opened next take o and p.

hint_keys (default "asdfghjkl") must be a non-empty set: configuration validation reports an error for an empty pool or a repeated key.

Families

members(family, app_ids, key_bindings) is the one definition of a family: the windows the key’s binding covers, or every window when the picker is not narrowed, in window order. The controller cycles through these windows and sends them to the overlay as the rows it draws, so the rows drawn are the rows cycled and the highlighted row is the window a commit activates.

Window order is recency order with the window you are on last (see Snapshot), so a family lists its windows from the most recently used to the least, the origin last:

InputPickerSelection
A keyNarrowed to the key’s familyThe family’s most recent window other than the origin
The same key againUnchangedOne window on within the family, wrapping
Alt+Tab / Alt+Space again, DownUnchangedOne window on within the family, wrapping
Shift with the activation, UpUnchangedOne window back within the family, wrapping
Another keyNarrowed to that key’s familyThat family’s most recent window other than the origin
BackspaceEvery windowUnchanged
A key without windows, with a launchNarrowed; shows Launch <command> (its row, revealed)Unchanged (its row, revealed); the launch is staged
A key without windows or launchUnchangedUnchanged
?Reveals the launches after the windows; again, hides themUnchanged; a selected launch row hidden returns to the selection before ?

The modifier release or Enter commits the selection, or the staged launch. With twelve Edge windows open, Alt+Space then w (or e, both on the Edge badges) narrows to Edge at the most recent one, and each further Space, Tab, or w moves to the next Edge window in recency order.

Revealed Launches

? in the picker reveals what the keys imply but the window rows do not show: a row, after the windows, for each application a key would launch because no window of its family is open (hints::launch_keys, the keys with a launch whose family is empty). Each launch is one row; its badge is every key that launches it, and its title column names the application. The picker is otherwise unchanged: the rows are cycled, narrowed, and committed as windows are, and the release or Enter on a revealed row launches it as its key would (Focus-or-Launch). ? again hides them.

The revealed rows are read from the same key bindings, by the same family rule, as the badges and the keys: a key is on an open window’s badge or on a revealed row, never both, and a key that does nothing (turned off, or without a launch and without a window) is on neither.

Key Bindings

The key_bindings map in WmConfig maps a key to the applications it covers and what it launches:

[profiles.default.wm.key_bindings.f]
apps = ["firefox", "org.mozilla.firefox"]
launch = "firefox"

A pattern of apps covers an application, ignoring case, when it equals the application ID or the application’s name (org.mozilla.firefox is named firefox). Every key is exactly one character: configuration validation reports an error for any other.

Roles

A binding with a role follows the desktop’s default application for that role:

[profiles.default.wm.key_bindings.w]
role = "web-browser"

daemon-launcher resolves each role (Default Applications) when an activation starts (Snapshot). The resolved application’s window app IDs join the binding’s apps, and its desktop entry becomes the launch when the binding names none. A role the desktop names no application for leaves the binding as configured. The roles are web-browser, files, mail, music, video, photos, calendar, terminal, text-editor, app-store, settings, and system-monitor.

Default Key Bindings

The compiled key bindings are the lowest configuration layer:

KeyBindingLaunch
tterminal rolethe role’s application
nfiles rolethe role’s application
xtext-editor rolethe role’s application
wweb-browser rolethe role’s application
mmail rolethe role’s application
umusic role, and spotifythe role’s application
pvideo rolethe role’s application
iphotos rolethe role’s application
kcalendar rolethe role’s application
aapp-store rolethe role’s application
osettings rolethe role’s application
rsystem-monitor rolethe role’s application
gghostty, com.mitchellh.ghosttyghostty
ffirefox, org.mozilla.firefoxfirefox
emicrosoft-edge, com.microsoft.Edgemicrosoft-edge
cchromium, google-chrome–
vcode, Code, cursor, Cursorcode
sslack, Slackslack
ddiscord, Discorddiscord

Stacking

Every layer stacks a key’s binding field by field, the compiled bindings as the lowest layer and the configuration files over them as every table stacks (see the README’s Configuration section): a field a layer sets replaces that field below it, and a field it leaves out keeps the value below. A key no layer binds keeps its compiled binding; an empty table changes nothing.

# w keeps following the web-browser role, but launches Firefox.
[profiles.default.wm.key_bindings.w]
launch = "firefox"

TOML has no null, so the two optional fields have a value that clears them, and enabled turns a key off, freeing it for application initials:

FieldClears or turns off
rolerole = "none": the key follows no role
launchlaunch = "": the key focuses only
enabledenabled = false: the key neither focuses nor launches
# w is Firefox whatever the desktop's default browser.
[profiles.default.wm.key_bindings.w]
role = "none"
apps = ["firefox", "org.mozilla.firefox"]
launch = "firefox"

# p is free for application initials.
[profiles.default.wm.key_bindings.p]
enabled = false

Focus-or-Launch

When a typed key has no window, the controller looks it up with hints::binding_for_key(key, key_bindings) (case-insensitive). If the binding has a launch command:

  1. A pending launch is staged with the binding’s command, tags, and launch_args.
  2. The overlay shows the staged intent (Launch <command>), or, with the launches revealed, selects the key’s row.
  3. The launch executes on modifier release or Enter (see Staged Launch).

A key with neither a window nor a launch command changes nothing.

Tags and Launch Args

Each WmKeyBinding can carry tags and launch_args:

[profiles.default.wm.key_bindings.g]
apps = ["ghostty"]
launch = "ghostty"
tags = ["dev-rust", "ai-tools"]
launch_args = ["--working-directory=/workspace"]
  • tags are forwarded to daemon-launcher in the LaunchExecute IPC message for launch profile composition (environment variable injection, secret fetching, Nix devshell activation). Tags support qualified cross-profile references using colon syntax (e.g., "work:corp").
  • launch_args are appended to the launched command’s argument list.