Skip to content

Route new app windows to named workspaces ​

Give workspaces stable IDs, then place each matching new window on its workspace when it opens. Replace the example app IDs with the values reported by gnoblinctl window list --json.

lua
gnoblin.configure {
    window_management = {
        dynamic_workspaces = false,
        num_workspaces = 3,
        workspace_names = {"Code", "Web", "Chat"},
        workspace_ids = {"code", "web", "chat"},
    },
}

gnoblin.window_rule {
    match = {type = "window", app_id = [[^org.gnome.TextEditor$]]},
    workspace = {id = "code"},
}

gnoblin.window_rule {
    match = {type = "window", app_id = [[^org.mozilla.firefox$]]},
    workspace = {id = "web"},
}

gnoblin.window_rule {
    match = {type = "window", app_id = [[^org.gnome.Fractal$]]},
    workspace = {id = "chat"},
}
OptionValues and defaultEffect
dynamic_workspacesBoolean; default falseKeeps the configured workspace count fixed.
num_workspacesInteger 1–36; default 4Sets the number of workspaces.
workspace_namesUp to 36 strings, max 80 chars each; default {}Labels workspaces by position.
workspace_idsUp to 36 unique IDs; default {}Keeps rule targets stable if positions change.
match.app_idJavaScript regular expression; unset matches any appSelects windows by application ID.
workspaceDeclared {id = "code"} or {number = 1..36}; unsetPlaces a matching new normal window on that workspace.

Workspace IDs start with a letter or digit. They may also contain ., _ or -. The example declares its three IDs in workspace order; each placement ID must be declared there. Numeric targets are one-based positions.

App ID patterns are case-sensitive JavaScript regular expressions. Use ^ and $ to match the whole ID. Reload the configuration to apply these settings.

Placement happens once; it does not lock a window to its workspace. You can move it afterward, and Gnoblin will leave it there.

  • If an app reuses an existing window, Gnoblin does not place it again.
  • Dialogs stay with their parent window.
  • If the target workspace is unavailable, the new window stays where it opened.

See workspace rules and the window-management reference.