diff --git a/bin/omarchy-install-service-sunshine b/bin/omarchy-install-service-sunshine index 3ffa9b96..b7128aa0 100755 --- a/bin/omarchy-install-service-sunshine +++ b/bin/omarchy-install-service-sunshine @@ -9,6 +9,11 @@ TCP_PORTS=(47984 47989 48010) UDP_PORTS=(5353 47998 47999 48000 48002 48010) PRIVATE_CIDRS=(10.0.0.0/8 172.16.0.0/12 192.168.0.0/16) UFW_COMMENT="omarchy-sunshine" +SUNSHINE_ADMIN_APP="Sunshine Admin" +SUNSHINE_ADMIN_URL="https://localhost:47990" +SUNSHINE_ICON_SOURCE="/usr/share/sunshine/web/images/logo-sunshine-45.png" +SUNSHINE_ICON_NAME="Sunshine Admin.png" +WEBAPP_ICON_DIR="$HOME/.local/share/applications/icons" open_ufw_port_for_private_lans() { local proto="$1" @@ -50,6 +55,13 @@ open_ufw_ports() { sudo ufw reload } +install_admin_webapp() { + mkdir -p "$WEBAPP_ICON_DIR" + cp "$SUNSHINE_ICON_SOURCE" "$WEBAPP_ICON_DIR/$SUNSHINE_ICON_NAME" + omarchy-webapp-install "$SUNSHINE_ADMIN_APP" "$SUNSHINE_ADMIN_URL" "$SUNSHINE_ICON_NAME" + omarchy-restart-walker +} + echo "Installing Sunshine..." omarchy-pkg-add sunshine systemctl --user enable --now sunshine @@ -57,5 +69,9 @@ systemctl --user enable --now sunshine echo "Opening Sunshine firewall ports..." open_ufw_ports +echo "Installing Sunshine admin web app..." +install_admin_webapp +omarchy-launch-webapp "$SUNSHINE_ADMIN_URL" >/dev/null 2>&1 & + echo "" echo "Sunshine has been installed and its Moonlight streaming ports are open for private LANs and Tailscale." diff --git a/bin/omarchy-remove-service-sunshine b/bin/omarchy-remove-service-sunshine index d98d49c3..50862307 100755 --- a/bin/omarchy-remove-service-sunshine +++ b/bin/omarchy-remove-service-sunshine @@ -8,6 +8,7 @@ set -e TCP_PORTS=(47984 47989 48010) UDP_PORTS=(5353 47998 47999 48000 48002 48010) PRIVATE_CIDRS=(10.0.0.0/8 172.16.0.0/12 192.168.0.0/16) +SUNSHINE_ADMIN_APP="Sunshine Admin" delete_ufw_rule() { sudo ufw --force delete "$@" 2>/dev/null || true @@ -52,6 +53,7 @@ close_ufw_ports() { systemctl --user disable --now sunshine 2>/dev/null || true omarchy-pkg-drop sunshine +omarchy-webapp-remove "$SUNSHINE_ADMIN_APP" 2>/dev/null || true close_ufw_ports echo ""