fix(hyprdrive/orbit-menu): launch Tools/Scripts via hl.dsp.exec_cmd

`hyprctl dispatch` evaluates its argument as Lua here (hyprlua), so the old
native `dispatch exec <cmd>` form parsed as a Lua syntax error and was silently
dropped — every Tools/Scripts/Management entry failed to launch. Route through
hl.dsp.exec_cmd(...) instead (matching binds.lua), keeping the [tag ...] rule
prefix support.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
main
Amir Alexander Abdelbaki 2026-07-19 16:21:28 +02:00
parent a534952c1c
commit 50b80cd5ce
1 changed files with 8 additions and 2 deletions

View File

@ -20,8 +20,14 @@ from lib.proc import fire
def launch(cmd: str) -> None: def launch(cmd: str) -> None:
"""Run cmd via Hyprland's exec dispatcher — cmd may carry a `[tag ...]` / """Run cmd via Hyprland's exec dispatcher — cmd may carry a `[tag ...]` /
`[workspace ...]` window-rule-on-launch prefix, same as binds.lua.""" `[workspace ...]` window-rule-on-launch prefix, same as binds.lua.
fire(["hyprctl", "dispatch", "exec", cmd])
NB: `hyprctl dispatch` evaluates its argument as Lua here (hyprlua), so this
must go through `hl.dsp.exec_cmd(...)` NOT the native `dispatch exec <cmd>`
form, which Lua parses as a syntax error and silently drops (see binds.lua's
`hl.dsp.exec_cmd("[tag +mixer] ...")`)."""
esc = cmd.replace("\\", "\\\\").replace('"', '\\"')
fire(["hyprctl", "dispatch", f'hl.dsp.exec_cmd("{esc}")'])
def hyprshutdown(post_cmd: str | None = None) -> None: def hyprshutdown(post_cmd: str | None = None) -> None: