Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion for running spotify #40

Open
chipschap opened this issue Apr 10, 2019 · 3 comments
Open

Suggestion for running spotify #40

chipschap opened this issue Apr 10, 2019 · 3 comments

Comments

@chipschap
Copy link

This is just something I do on my own for my Linux system. Since Spotify has to already be running to play a track, I add this code to my startup (after helm-spotify-plus is loaded). This could probably be done more nicely, and is only for Linux, but it does what I need, namely, be sure Spotify is running before trying to play something.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun spotify-check (&rest args)
(interactive)
"See if spotify is running and if not, run it"
(if (not (string= (shell-command-to-string "pgrep -x "spotify"") ""))
(message "Spotify running")
(progn
(message "Starting Spotify")
(start-process "spotify" nil "spotify")
(sleep-for 3))
)
)

;;; To ensure spotify is running before trying to play stuff.
(advice-add 'helm-spotify-plus-play-href :before #'spotify-check)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@wandersoncferreira
Copy link
Owner

Sorry for the long time to comment your suggestion. It has been a very busy weather right here. I think we can split this addition into some steps: i) option to opt-in the functionality of starting a spotify client if none is present ii) default to only warn the user through a minibuffer message iii) if opt-in, try open the client, inform message if not succeded.

What you think about this? Can you submit a PR to accomplish those behaviors?

thanks

@chipschap
Copy link
Author

chipschap commented Jun 25, 2019 via email

@wandersoncferreira
Copy link
Owner

PR = Pull Request hehehe. It's the process of submitting code to contribute with a repository in github.

If you need guidance, don't wait to ask. I hope to be able to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants