feat: add zen-browser support and netflix webapp

This commit is contained in:
itsscb 2025-08-26 13:51:04 +02:00
parent adaaf14bce
commit ae97d900ac
2 changed files with 38 additions and 5 deletions

View File

@ -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 Chromiumbased 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 Firefoxbased use Firefoxstyle 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 minimalUI mode you prefer
# --new-window : normal window
# --private-window : incognitostyle
# --kiosk : fullscreen 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}"

View File

@ -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