diff --git a/bin/omarchy-install-service-spotify b/bin/omarchy-install-service-spotify index beae99397a7..7c23a66d7db 100755 --- a/bin/omarchy-install-service-spotify +++ b/bin/omarchy-install-service-spotify @@ -6,10 +6,26 @@ set -e echo "Installing Spotify..." -omarchy-pkg-add spotify -echo "Opening Spotify..." -setsid uwsm-app -- /usr/bin/spotify >/dev/null 2>&1 & +if pacman -Q spotify &>/dev/null || pacman -Si spotify &>/dev/null; then + omarchy-pkg-add spotify -echo "" -echo "Spotify has been installed." + echo "Opening Spotify..." + setsid uwsm-app -- /usr/bin/spotify >/dev/null 2>&1 & + + echo "" + echo "Spotify has been installed." +else + # No aarch64 Spotify client exists, so on systems the repos cannot serve the + # web app is the client. omarchy-launch-spotify already matches a window + # whose class or title contains "spotify", so the SUPER+SHIFT+M binding + # focuses this app the same as the native one. + echo "No native Spotify client is available on this system; installing the web app." + omarchy-webapp-install "Spotify" "https://open.spotify.com" "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/spotify.png" + + echo "Opening Spotify..." + setsid omarchy-launch-webapp "https://open.spotify.com" >/dev/null 2>&1 & + + echo "" + echo "Spotify has been installed as a web app." +fi diff --git a/bin/omarchy-launch-spotify b/bin/omarchy-launch-spotify index d94202a330f..54e43bac4c3 100755 --- a/bin/omarchy-launch-spotify +++ b/bin/omarchy-launch-spotify @@ -10,6 +10,8 @@ if [[ -n $WINDOW_ADDRESS ]]; then hyprctl dispatch "hl.dsp.focus({ window = \"address:$WINDOW_ADDRESS\" })" >/dev/null 2>&1 || hyprctl dispatch focuswindow "address:$WINDOW_ADDRESS" elif [[ -x /usr/bin/spotify ]]; then exec setsid uwsm-app -- /usr/bin/spotify +elif [[ -f $HOME/.local/share/applications/Spotify.desktop ]]; then + exec omarchy-launch-webapp "https://open.spotify.com" else exec omarchy-launch-floating-terminal-with-presentation omarchy-install-service-spotify fi diff --git a/default/omarchy/omarchy-menu.jsonc b/default/omarchy/omarchy-menu.jsonc index 751efa00c39..094b7f4ecc1 100644 --- a/default/omarchy/omarchy-menu.jsonc +++ b/default/omarchy/omarchy-menu.jsonc @@ -218,7 +218,7 @@ "install.browser.zen": {"icon":"󰖟","label":"Zen","disabled":"omarchy-pkg-present zen-browser-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser zen'"}, "install.service.1password": {"icon":"󰢁","label":"1Password","disabled":"omarchy-pkg-present 1password","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-1password"}, "install.service.dropbox": {"icon":"","label":"Dropbox","disabled":"omarchy-pkg-present dropbox","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-dropbox"}, - "install.service.spotify": {"icon":"󰓇","label":"Spotify","disabled":"omarchy-pkg-present spotify","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-spotify"}, + "install.service.spotify": {"icon":"󰓇","label":"Spotify","disabled":"omarchy-pkg-present spotify || [[ -f $HOME/.local/share/applications/Spotify.desktop ]]","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-spotify"}, "install.service.signal": {"icon":"󰭹","label":"Signal","disabled":"omarchy-pkg-present signal-desktop","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-signal"}, "install.service.tailscale": {"icon":"","label":"Tailscale","disabled":"omarchy-pkg-present tailscale","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-tailscale"}, "install.service.nordvpn": {"icon":"󱇱","label":"NordVPN","disabled":"omarchy-pkg-present nordvpn-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-nordvpn"},