I found your idea interesting and spent a little bit working on part of it. The below snippet successfully checks if Spotify is running and reports "Running" or "not running" depending. This could be modified to launch or kill Spotify instead of echoing the status.
#!/bin/bash
PROCESS=spotify
number=$(ps aux | grep -v grep | grep -ci $PROCESS)
if [ $number -gt 0 ]
then
echo Running;
else
echo not running;
fi
https://xkcd.com/378/
--force --no-confirm
Used those when trying to install new gpu drivers... Forgot to specify which version... many lessons were learned that day.
And then they get a GDPR right to be forgotten removal request and have to dig the whole thing back up?
And on your cake day and everything!
I found your idea interesting and spent a little bit working on part of it. The below snippet successfully checks if Spotify is running and reports "Running" or "not running" depending. This could be modified to launch or kill Spotify instead of echoing the status.