summaryrefslogtreecommitdiff
path: root/media-sound/spotify/files/spotify-wrapper
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-08-19 08:36:10 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-08-19 08:36:10 +0100
commit19a10140592052698d68be11db5a59bc88fcf528 (patch)
tree4af8926304f638633a3b9d0947126950c8cb01a0 /media-sound/spotify/files/spotify-wrapper
parentd1989de9d66ba4285e46f80cd571d5a82beae871 (diff)
gentoo auto-resync : 19:08:2022 - 08:36:10
Diffstat (limited to 'media-sound/spotify/files/spotify-wrapper')
-rw-r--r--media-sound/spotify/files/spotify-wrapper45
1 files changed, 30 insertions, 15 deletions
diff --git a/media-sound/spotify/files/spotify-wrapper b/media-sound/spotify/files/spotify-wrapper
index db8f8b948780..fd6c4f314f9f 100644
--- a/media-sound/spotify/files/spotify-wrapper
+++ b/media-sound/spotify/files/spotify-wrapper
@@ -3,21 +3,36 @@
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 "$@"
+ echo "Launching spotify with Gnome systray integration."
+ spotify-dbus.py "$@"
elif command -v 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
- spotify-tray \
- --client-path="$SPOTIFY_HOME/spotify" --toggle $minimized -- "$@"
+ echo "Launching spotify with generic systray integration."
+ minimized=
+ for arg; do
+ if [ "$arg" = --minimized ]; then
+ minimized=$arg
+ break
+ fi
+ done
+ spotify-tray \
+ --client-path="$SPOTIFY_HOME/spotify" --toggle $minimized -- "$@"
else
- echo "Neither gnome-integration-spotify nor spotify-tray are installed."
- echo "Launching spotify without systray integration."
- exec "$SPOTIFY_HOME/spotify" "$@"
+ 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