omarchy-launch-webapp asked xdg-settings for the default browser with BROWSER still set to omarchy-launch-browser, which sends it down a slower path to the same answer: ~105ms instead of ~30ms on every web app launch. Unset it, as omarchy-launch-browser already does. omarchy-cmd-terminal-cwd found the focused terminal's shell with pgrep, which scans all of /proc on every new terminal. Read the terminal's child lists from /proc instead, keeping the newest child as before. Web app wrapper overhead drops from ~111ms to ~34ms, and a new terminal appears in ~77ms instead of ~90ms. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
16 lines
613 B
Bash
Executable File
16 lines
613 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Launch a URL as a web app in the default supported browser
|
|
# omarchy:args=<url>
|
|
|
|
# The session sets BROWSER to omarchy-launch-browser, which sends xdg-settings
|
|
# down a slower path (~100ms against ~30ms) to the same answer.
|
|
browser=$(env -u BROWSER xdg-settings get default-web-browser)
|
|
|
|
case $browser in
|
|
google-chrome* | brave* | microsoft-edge* | opera* | vivaldi* | helium*) ;;
|
|
*) browser="chromium.desktop" ;;
|
|
esac
|
|
|
|
exec setsid uwsm-app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$1" "${@:2}"
|