To open a new terminal in the focused terminal's directory, the launcher asked Hyprland for the active window with hyprctl, ~10ms on every SUPER+RETURN. The binding now reads the pid from hl.get_active_window() and passes it as --pid. Without one, from the menu or a shell, the launcher asks Hyprland as before. The bind is now a Lua function, which Hyprland reports only as __lua, so o.bind_commands records the command it stands for and the keybindings menu still launches a terminal when the entry is picked. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
13 lines
304 B
Bash
Executable File
13 lines
304 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Launch a terminal in the active terminal's current directory
|
|
# omarchy:args=[--pid=<terminal-pid>] [command...]
|
|
|
|
pid=""
|
|
if [[ ${1:-} == --pid=* ]]; then
|
|
pid=${1#--pid=}
|
|
shift
|
|
fi
|
|
|
|
exec setsid uwsm-app -- xdg-terminal-exec --dir="$(omarchy-cmd-terminal-cwd "$pid")" "$@"
|