Closed jgabriel98 closed 3 years ago
@jgabriel98 can you give steps to reproduce this? i've never had this issue with spotify, and if the player is still open in the background then your check should still theoretically suffer from the same issue (as playerctl -p spotify status
should still return Paused/Stopped, neither of which are an empty string as the script checks for)
closing for now, feel free to reopen if you still experience this issue and can provide consistent reproductive steps / environment
The script used this command to detect if the spotify player was running:
${if_running spotify} ...stuff here...
What this command really do: it looks for a process that matches the given name (in this case, 'spotify').
But the problem is: some players have multiple process, and some of those always keep running, as a background task (i guess). And that is the case with spotify.
So, this lead us to the bug: after closing the player, one process remain running. So the script thinks the player is running (but it's not).
Solution
changed
${if_running spotify}
to${if_match "" != "${exec playerctl -p spotify status}}
, so now it will really check for the player status, not for the player process.