Skip to content
6 changes: 3 additions & 3 deletions src/cmd/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ func SpotifyKill() {
exec.Command("taskkill", "/F", "/IM", "spotify.exe").Run()
}
case "linux":
isRunning := exec.Command("pgrep", "spotify")
isRunning := exec.Command("pgrep", "-x", "spotify")
_, err := isRunning.Output()
if err == nil {
exec.Command("pkill", "spotify").Run()
exec.Command("pkill", "-x", "spotify").Run()
}
case "darwin":
isRunning := exec.Command("sh", "-c", "ps aux | grep 'Spotify' | grep -v grep")
_, err := isRunning.CombinedOutput()
if err == nil {
exec.Command("pkill", "Spotify").Run()
exec.Command("pkill", "-x", "Spotify").Run()
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
}
Expand Down