Skip to content

Instantly share code, notes, and snippets.

@chaitunya
chaitunya / start_spotify.sh
Last active May 16, 2023 00:18
Simple script to automatically go to a Spotify window if it's already open or create a new instance if it's not
#!/usr/bin/bash
pgrep -f /app/extra/share/spotify/spotify
if [ $? = 1 ]; then
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client $*
# Non-flatpak version of spotify:
# spotify $*
else
wmctrl -x -a spotify
fi