WARNING This project is in its very initial development stage, not all
features are implemented yet, usage API still subjected to change until 1.0.0
This CLI application displays the currently playing music from Spotify on your tmux status bar.
- Go 1.16 or later
- tmux
- Spotify Premium account
-
Clone this repository:
git clone https://github.com/yourusername/tmux-spotify-cli.git cd tmux-spotify-cli
-
Create a Spotify application:
- Go to https://developer.spotify.com/dashboard/
- Create a new application
- In your app settings, add
http://localhost:8080/callback
to the Redirect URIs - Note down the Client ID and Client Secret
-
Create a
.tmux-spotify-env
file in your home directory:echo "SPOTIFY_ID=your_client_id" > ~/.tmux-spotify-env echo "SPOTIFY_SECRET=your_client_secret" >> ~/.tmux-spotify-env echo "SPOTIFY_REDIRECT_URI=http://localhost:8080/callback" >> ~/.tmux-spotify-env
Replace
your_client_id
andyour_client_secret
with the values from your Spotify app. -
Build the application:
make build
-
Add the following line to your
.tmux.conf
:set -g status-interval 5
-
Run the application:
./tmux-spotify-cli
-
Follow the URL provided to authorize the application with your Spotify account.
-
The currently playing track will now appear in your tmux status bar.
If you encounter an "INVALID_CLIENT: Invalid redirect URI" error:
- Double-check that the redirect URI in your
.tmux-spotify-env
file matches exactly with what you've set in your Spotify app settings. - Ensure there are no trailing spaces or newlines in the
.tmux-spotify-env
file. - Verify that you've added the correct redirect URI to your Spotify app settings in the Spotify Developer Dashboard.
- Use
make dev
to build for development with race detection enabled. - Use
make test
to run tests. - Use
make build
to build for production.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.