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:
- Every enabled static key is reserved, whether or not its application is open; a key turned
off (
enabled = false) is free. - 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. - 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_keyskey; without one, it has no key, shows·, and is reached by cycling. - 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:
| Input | Picker | Selection |
|---|---|---|
| A key | Narrowed to the key’s family | The family’s most recent window other than the origin |
| The same key again | Unchanged | One window on within the family, wrapping |
| Alt+Tab / Alt+Space again, Down | Unchanged | One window on within the family, wrapping |
| Shift with the activation, Up | Unchanged | One window back within the family, wrapping |
| Another key | Narrowed to that key’s family | That family’s most recent window other than the origin |
| Backspace | Every window | Unchanged |
| A key without windows, with a launch | Narrowed; shows Launch <command> (its row, revealed) | Unchanged (its row, revealed); the launch is staged |
| A key without windows or launch | Unchanged | Unchanged |
? | Reveals the launches after the windows; again, hides them | Unchanged; 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:
| Key | Binding | Launch |
|---|---|---|
t | terminal role | the role’s application |
n | files role | the role’s application |
x | text-editor role | the role’s application |
w | web-browser role | the role’s application |
m | mail role | the role’s application |
u | music role, and spotify | the role’s application |
p | video role | the role’s application |
i | photos role | the role’s application |
k | calendar role | the role’s application |
a | app-store role | the role’s application |
o | settings role | the role’s application |
r | system-monitor role | the role’s application |
g | ghostty, com.mitchellh.ghostty | ghostty |
f | firefox, org.mozilla.firefox | firefox |
e | microsoft-edge, com.microsoft.Edge | microsoft-edge |
c | chromium, google-chrome | – |
v | code, Code, cursor, Cursor | code |
s | slack, Slack | slack |
d | discord, Discord | discord |
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:
| Field | Clears or turns off |
|---|---|
role | role = "none": the key follows no role |
launch | launch = "": the key focuses only |
enabled | enabled = 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:
- A pending launch is staged with the binding’s command,
tags, andlaunch_args. - The overlay shows the staged intent (
Launch <command>), or, with the launches revealed, selects the key’s row. - 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"]
tagsare forwarded todaemon-launcherin theLaunchExecuteIPC 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_argsare appended to the launched command’s argument list.