Autostart an app onto a specific workspace under the Lua config
Issue #10137 shows the uwsm_app-daemon error quoted in the symptom, and /usr/share/omarchy/default/hypr/helpers.lua on 4.0.4-1 still defines o.launch as "uwsm-app -- " .. command and o.launch_on_start as o.exec_on_start(o.launch(command)). The Hyprland dispatchers wiki page documents exec_cmd(cmd, { rules }) and says rules are matched by the spawned PID, so a forking process will not match. Discussion 14619 supports the per-launch hl.exec_cmd(app, { workspace = "N silent" }) form and the ghostty +new-window handoff case. The window-rules wiki page documents the workspace effect with the " silent" suffix, and o.window(match, rules) in helpers.lua maps a string to match.class. Two points are worth noting without a correction. First, Executor.cpp in v0.56.2 also registers an activation-token match beside the PID, so a child that passes the token on can still match. The wiki and the record both simplify this to PID. Second, the same source parses a leading [rules] prefix in hl.exec_cmd, so hl.exec_cmd("[workspace 2 silent] firefox") also works directly, as the issue shows. The record's rule-table form is equivalent. Not exercised: no autostart was changed or logged in here.
Symptom
An autostart line such as o.launch_on_start("[workspace 2 silent] firefox") in ~/.config/hypr/autostart.lua never opens anything, with no error on screen. journalctl --user shows uwsm_app-daemon[...]: sent: error 'Error: Command not found: "[workspace"' 1. Or, on a hand-written Lua config, hl.exec_cmd(...) autostarts open on the current workspace and ignore the workspace you asked for.
Cause
Omarchy's o.launch() and o.launch_on_start() prefix the command with uwsm-app -- . uwsm-app parses its own argv and treats [workspace as the program name, so the hyprlang-style bracket prefix never reaches Hyprland. Separately, Hyprland applies exec rules by the PID it spawned. A command that hands off to another process (a wrapper like uwsm-app, a single-instance app such as a browser that is already running, ghostty +new-window) opens a window from a PID Hyprland did not record, so the rule never matches.
Fix
Use Lua's rule table on hl.exec_cmd directly, inside the start event, so it runs once at login:
**Omarchy 4**, in ~/.config/hypr/autostart.lua:
hl.on("hyprland.start", function()
hl.exec_cmd("foot", { workspace = "3 silent" })
hl.exec_cmd("spotify-launcher", { workspace = "special silent" })
end)
This bypasses uwsm-app, so the app is not placed in its own uwsm scope.
For apps that fork or reuse an existing instance, use a class rule instead. It is permanent rather than per launch:
-- ~/.config/hypr/hyprland.lua
o.window("^(firefox)$", { workspace = "2 silent" })
o.launch_on_start("firefox")
Find the class with hyprctl clients -j | jq -r '.[].class'.
**Plain Arch.** The same hl.exec_cmd(cmd, { workspace = "N silent" }) form inside hl.on("hyprland.start", ...), or hl.window_rule({ match = { class = "^(firefox)$" }, workspace = "2 silent" }).
Verify
Log out and in. hyprctl clients -j | jq -r '.[] | "\(.workspace.name) \(.class)"' shows each app on its intended workspace.
Sources
- https://github.com/omacom/omarchy/issues/10137
- https://github.com/hyprwm/Hyprland/discussions/14619
- https://wiki.hypr.land/Configuring/Basics/Dispatchers/
- https://github.com/hyprwm/hyprland-wiki/blob/main/content/configuring/core/dispatchers.md
- https://github.com/hyprwm/hyprland-wiki/blob/main/content/configuring/core/rules/window-rules.md
- https://github.com/hyprwm/Hyprland/blob/v0.56.2/src/config/supplementary/executor/Executor.cpp
- https://github.com/omacom/omarchy/blob/quattro/default/hypr/helpers.lua