From ae97d900acf5f517bba75524e23632c68aa0c61a Mon Sep 17 00:00:00 2001 From: itsscb Date: Tue, 26 Aug 2025 13:51:04 +0200 Subject: [PATCH] feat: add zen-browser support and netflix webapp --- bin/omarchy-launch-webapp | 42 +++++++++++++++++++++++++++++++----- install/packaging/webapps.sh | 1 + 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/bin/omarchy-launch-webapp b/bin/omarchy-launch-webapp index 24f48e9c..e376f502 100755 --- a/bin/omarchy-launch-webapp +++ b/bin/omarchy-launch-webapp @@ -1,10 +1,42 @@ #!/bin/bash - +# Resolve the default desktop file browser=$(xdg-settings get default-web-browser) -case $browser in -google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi*) ;; -*) browser="chromium.desktop" ;; +# Normalise known Chromium‑based browsers +case "$browser" in + google-chrome*|brave-browser*|microsoft-edge*|opera*|vivaldi*) + exec_cmd=$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' \ + "${HOME}/.local/share/applications/$browser" \ + "/usr/share/applications/$browser" 2>/dev/null | head -1) + exec setsid uwsm app -- "$exec_cmd" --app="$1" "${@:2}" + ;; + zen*|zen-browser*) + # Zen is Firefox‑based – use Firefox‑style flags + exec_cmd=$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' \ + "${HOME}/.local/share/applications/$browser" \ + "/usr/share/applications/$browser" \ + "/var/lib/flatpak/exports/share/applications/$browser" 2>/dev/null | head -1) + + # Fallback to the binary name if Exec line is empty + exec_cmd=${exec_cmd:-zen} + + # Choose the minimal‑UI mode you prefer + # --new-window : normal window + # --private-window : incognito‑style + # --kiosk : full‑screen kiosk + exec setsid "$exec_cmd" --new-window "$1" "${@:2}" + ;; + *) + # Unknown browser – default to Chromium + exec setsid uwsm app -- chromium --app="$1" "${@:2}" + ;; esac -exec setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$1" "${@:2}" +# browser=$(xdg-settings get default-web-browser) +# +# case $browser in +# google-chrome* | brave-browser* | microsoft-edge* | opera* | vivaldi* | zen*) ;; +# *) browser="chromium.desktop" ;; +# esac +# +# exec setsid uwsm app -- $(sed -n 's/^Exec=\([^ ]*\).*/\1/p' {~/.local,/usr}/share/applications/$browser 2>/dev/null | head -1) --app="$1" "${@:2}" diff --git a/install/packaging/webapps.sh b/install/packaging/webapps.sh index fa880ce1..87f22543 100755 --- a/install/packaging/webapps.sh +++ b/install/packaging/webapps.sh @@ -8,6 +8,7 @@ # omarchy-webapp-install "Google Messages" https://messages.google.com/web/conversations https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/google-messages.png omarchy-webapp-install "Kagi Assistant" https://kagi.com/assistant https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/chatgpt.png omarchy-webapp-install "YouTube" https://youtube.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/youtube.png +omarchy-webapp-install "Netflix" https://netflix.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/netflix.png omarchy-webapp-install "GitHub" https://github.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/github-light.png # omarchy-webapp-install "X" https://x.com/ https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/x-light.png # omarchy-webapp-install "Figma" https://figma.com/ https://www.veryicon.com/download/png/application/app-icon-7/figma-1?s=256