Last active
May 16, 2023 00:18
-
-
Save chaitunya/4cf0788283f324394efc361443aee064 to your computer and use it in GitHub Desktop.
Simple script to automatically go to a Spotify window if it's already open or create a new instance if it's not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple and very efficient. I love it!