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

Fix for spotify song info for zsh users #442

Open
pejrich opened this issue May 26, 2022 · 0 comments
Open

Fix for spotify song info for zsh users #442

pejrich opened this issue May 26, 2022 · 0 comments

Comments

@pejrich
Copy link

pejrich commented May 26, 2022

it runs the command in bash which may make some of the commands fail and you just see "error". This fixed it for me, after much struggle to get a non-double quoted command(i'm not very good at bash, so if this can be improved, please let me know)

This doesn't handle non-alphanum song/artist names.

Add to ~/.bash_profile

spotifyInfo() { f=$(/usr/local/bin/spotify/SpotifyControl info); if [[ $f =~ Artist:\ +([A-Za-z0-9\ ]+).+Track:\ +([A-Za-z0-9\ ]+).+URI: ]]; then echo ${BASH_REMATCH[1]} - ${BASH_REMATCH[2]}; else echo "error";fi }

Change your "inline" to:

"inline": "source ~/.bash_profile; spotifyInfo",
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

1 participant