diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-10-04 19:20:22 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-10-04 19:20:22 +0100 |
commit | 874520e63d7f7ccbb8fefe7bcbd4c5d72a77a247 (patch) | |
tree | 015a7cc445ce0ac0099c9d5d28b12f50e2de86e6 /media-sound/spotify/files/spotify-wrapper | |
parent | fccc1842491956b425852cfcaede76771d558d28 (diff) |
media-sound/spotify : revision bump (https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=517e978ef861d2037bf46f4d96e78c2bacbcef3b)
Diffstat (limited to 'media-sound/spotify/files/spotify-wrapper')
-rw-r--r-- | media-sound/spotify/files/spotify-wrapper | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/media-sound/spotify/files/spotify-wrapper b/media-sound/spotify/files/spotify-wrapper new file mode 100644 index 00000000..862fa4c6 --- /dev/null +++ b/media-sound/spotify/files/spotify-wrapper @@ -0,0 +1,38 @@ +#!/bin/sh + +export LD_LIBRARY_PATH="/usr/$LIBDIR/apulse" + +if command -v spotify-dbus.py > /dev/null; then + echo "Launching spotify with Gnome systray integration." + spotify-dbus.py "$@" +elif [ -e "$SPOTIFY_HOME/spotify-tray" ] > /dev/null; then + echo "Launching spotify with generic systray integration." + minimized= + for arg; do + if [ "$arg" = --minimized ]; then + minimized=$arg + break + fi + done + GDK_BACKEND="x11" "$SPOTIFY_HOME/spotify-tray" \ + --client-path="$SPOTIFY_HOME/spotify" --toggle $minimized -- "$@" +else + if pgrep -f "Spotify/[0-9].[0-9].[0-9]" > /dev/null; then + busline="org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri ${1}" + echo "Spotify is already running" + echo "Sending ${busline} to dbus" + if command -v qdbus &> /dev/null; then + qdbus $busline + exit + fi + if command -v dbus-send &> /dev/null; then + dbus-send $busline + exit + fi + echo "No bus dispatcher found." + else + echo "Neither gnome-integration-spotify nor spotify-tray are installed." + echo "Launching spotify without systray integration." + exec "$SPOTIFY_HOME/spotify" "$@" + fi +fi |