Created
October 14, 2022 06:21
-
-
Save benyaminl/256eef9c20a9eb4c7dc6ae272ae8854b to your computer and use it in GitHub Desktop.
Show or Hide Spotify Flatpak, can be mapped to Thinkpad X220 ThinkVantage Button on XFCE
This file contains 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
#!/bin/bash | |
STATUS=$(ps -aux | grep share/spotify/spotify | grep -v grep | wc -l) | |
if [ $STATUS -gt 0 ] | |
then | |
activeWindow=$(xprop -id $(xprop -root _NET_ACTIVE_WINDOW | cut -d ' ' -f 5) WM_NAME | cut -d '"' -f 2) | |
if [[ $activeWindow =~ "Spotify" ]] | |
then | |
wmctrl -r "spotify" -b toggle,hidden | |
else | |
wmctrl -R Spotify | |
fi | |
else | |
/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=spotify --file-forwarding com.spotify.Client @@u %U @@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment