Add multi-profile support to web app installer#1266
Conversation
|
I think you need to simplify the web app view for this use case. After Omarchy ASCII logo, We're not creating a web app here. The profile already exists and is detected. You could replace the Omarchy ASCII logo with default browser icon. That'd be nice. Easy to grasp.
|
|
From Omarchy
#!/bin/bash
browser=$(xdg-settings get default-web-browser)
case $browser in
google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi*) ;;
*) browser="chromium.desktop" ;;
esac
# Extract the browser binary from the .desktop file
BROWSER_BIN="$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,~/.nix-profile,/usr}/share/applications/$browser 2>/dev/null | head -1)"
APP_URL="$1"
shift || true
# If a profile arg is provided (as $2 in the original), use it; otherwise launch without profile.
PROFILE_ARG=()
if [ -n "${1-}" ]; then
PROFILE_ARG=(--profile-directory="$1")
shift
fi
# Any remaining args after the profile name are forwarded as-is.
exec setsid uwsm app -- "$BROWSER_BIN" "${PROFILE_ARG[@]}" --app="$APP_URL" "$@"
#!/bin/bash
set -euo pipefail
# Usage:
# omarchy-launch-or-focus <window-pattern> [launch-command]
# omarchy-launch-or-focus <url> [profile] [extra browser flags...]
find_window_address() {
local pattern="$1"
hyprctl clients -j \
| jq -r --arg p "$pattern" '.[] | select((.class+" "+.title) | test($p;"i")) | .address' \
| head -n1
}
regex_escape() {
sed -e 's/[.[\*^$()+?{}|\\]/\\&/g' <<<"$1"
}
if (($# == 0)); then
echo "Usage:"
echo " omarchy-launch-or-focus <window-pattern> [launch-command]"
echo " omarchy-launch-or-focus <url> [profile] [extra browser flags...]"
exit 1
fi
arg1="$1"
if [[ "$arg1" =~ ^https?:// ]]; then
# ------------------ URL MODE ------------------
APP_URL="$1"
PROFILE="${2-}" # optional
shift || true
if [[ $# -gt 0 ]]; then shift; fi
EXTRA_FLAGS=("$@")
# Host (e.g., gemini.google.com, chatgpt.com)
host="${APP_URL#*://}"; host="${host%%/*}"
host_esc="$(regex_escape "$host")"
# Allow optional "__<segment>-" between host and profile, e.g. "__app-"
# Examples matched:
# chrome-gemini.google.com__app-Default
# chrome-chatgpt.com__-Default
# chrome-web.whatsapp.com__-Profile_1
if [[ -n "${PROFILE:-}" ]]; then
prof_as_is="$(regex_escape "$PROFILE")"
prof_uscore="$(regex_escape "${PROFILE// /_}")"
WINDOW_PATTERN="(^| )(chrome|chromium|brave|vivaldi|microsoft-edge|google-chrome)-${host_esc}(__[^ ]*-)(${prof_as_is}|${prof_uscore})( |$)"
else
# No profile provided: match any window of this host, regardless of the optional segment/profile
WINDOW_PATTERN="(^| )(chrome|chromium|brave|vivaldi|microsoft-edge|google-chrome)-${host_esc}(__[^ ]*)?( |$)"
fi
# Debug aid: show the pattern if DEBUG=1
[[ "${DEBUG:-0}" = "1" ]] && echo "Pattern: $WINDOW_PATTERN" >&2
if WINDOW_ADDRESS="$(find_window_address "$WINDOW_PATTERN")" && [[ -n "$WINDOW_ADDRESS" ]]; then
hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS"
exit 0
fi
# No match → delegate launching (no duplication of browser logic here)
if [[ -n "${PROFILE:-}" ]]; then
exec omarchy-launch-webapp "$APP_URL" "$PROFILE" "${EXTRA_FLAGS[@]}"
else
exec omarchy-launch-webapp "$APP_URL" "${EXTRA_FLAGS[@]}"
fi
else
# ---------------- PATTERN MODE (original) ----------------
WINDOW_PATTERN="$arg1"
LAUNCH_COMMAND="${2:-"uwsm app -- $WINDOW_PATTERN"}"
if WINDOW_ADDRESS="$(find_window_address "$WINDOW_PATTERN")" && [[ -n "$WINDOW_ADDRESS" ]]; then
hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS"
else
eval exec $LAUNCH_COMMAND
fi
fi |
|
This looks amazing waiting to see this in a new release. |
|
@Prajwal-Prathiksh thank you, I will try to fix it tomorrow or next week, I also need to resolve conflict with the webapp-install 🙂 |
Might need to change The default browser icon was a suggestion. I hadn't considered multi-browser setups. You nailed it. If DHH doesn't like |
| case $browser in | ||
| google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi* | helium-browser*) ;; | ||
| *) browser="chromium.desktop" ;; | ||
| google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi*) ;; |
There was a problem hiding this comment.
| google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi*) ;; | |
| google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi* | helium-browser*) ;; |
Helium browser was added last week #1945
More ideas: Of course, as rez1coder said, it depends on the DHH 🙂. |
|
@przemekmatsumoto How is the work going in this? I tested the script in Omarchy 3.1.0 and it worked great! Anything I can do to help expedite this PR? |
@mghextreme The only thing I can think of is changing the browser executable searches, as they're currently hardcoded (I tested this with specific packages from aur), and if someone downloads somehow a browser that doesn't have a properly named executable, it won't be found - so it won't be displayed in the installer: Therefore, I was wondering if I could add something that would search for names like google-chrome-stable, google-chrome, google-chrome-dev, google-chrome, etc. instead of just google-chrome-stable although I don't know if it's a "must have" 😄 |
|
@przemekmatsumoto IMHO, this is already improves the current Web App installation experience, and if it was up to me, I'd say to merge it and we can always leave to other people (that way be using these different browsers) to update these scripts in the future. Looking forward for you resolving the conflicts 🙏 |
|
I'm eagerly waiting, I hope it arrives soon. |
|
Conflicts resolved 🙂 |
|
Can we have this? I've tried it on my system and it work well. |
|
I am so excited about this feature! |
|
@dhh @ryanrhughes This feature seems ready with a lot of support behind it. Are we good to merge it? |
|
This is a very useful feature. |
|
Can we get a quick rebase here? I'd like to give this a spin. |
6441313 to
07670e1
Compare
|
Can´t wait to get this feature!! 🙏 |
There was a problem hiding this comment.
Pull request overview
This PR extends Omarchy’s web app installation/launch tooling to support installing the same web app multiple times using different Chromium-based browser profiles (e.g., work vs personal), and adds a dedicated “webapp” presentation logo.
Changes:
- Enhance
omarchy-webapp-installwith browser detection plus profile discovery/selection and updated.desktopgeneration. - Update webapp launching/focus scripts to incorporate profile-aware launching and window matching.
- Add a dedicated webapp ASCII logo and a script to present it in the installer flow.
Reviewed changes
Copilot reviewed 1 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
webapp-logo.txt |
Adds a new ASCII art logo intended for the webapp installer presentation. |
bin/omarchy-webapp-install |
Adds browser/profile selection logic and changes the generated Exec command to include profile/browser parameters. |
bin/omarchy-show-webapp-logo |
New helper to display the webapp logo from ~/.local/share/omarchy. |
bin/omarchy-launch-webapp |
Changes launch argument handling to support profile + browser selection when starting a webapp. |
bin/omarchy-launch-or-focus |
Extends focus-or-launch behavior to support URL/profile-driven focusing and launching. |
bin/omarchy-launch-floating-terminal-with-presentation |
Switches presentation logo when launching the webapp installer via the menu. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I had a chance to review One thing that might be worth considering before merging is improving the interface. The current positional arguments (URL, profile, browser) can be a bit hard to reason about and may become fragile over time. For example: omarchy-launch-webapp https://youtube.com "Profile 2" google-chromevs a flag-based approach: omarchy-launch-webapp \
--url https://youtube.com \
--profile "Profile 2" \
--browser google-chromeThis makes usage more explicit and easier to extend in the future. Also, since the current implementation assumes Chromium-style flags ( Happy to help refine this PR, test changes, or break it into smaller pieces if that makes it easier to move forward. |
|
Closing in favor of the newer and more comprehensive profile-aware webapp work in #6105. |



Add multi-profile support for web app installer
This PR enhances the web app installer to support multiple browser profiles, allowing users to create separate web apps from different Chromium profiles.
Changes:
Use case:
Users can now install the same web app (e.g., Teams, Discord) multiple times with different browser profiles, allowing separate work/personal accounts to run simultaneously.
Example: