Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danjeltahko/spotify-tmux
Spotify plugin for tmux to add & start playing your favorite playlists & albums.
https://github.com/danjeltahko/spotify-tmux
plugin spotify tmux
Last synced: 3 months ago
JSON representation
Spotify plugin for tmux to add & start playing your favorite playlists & albums.
- Host: GitHub
- URL: https://github.com/danjeltahko/spotify-tmux
- Owner: danjeltahko
- License: mit
- Created: 2023-10-12T21:05:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-17T18:14:37.000Z (about 1 year ago)
- Last Synced: 2024-08-04T04:06:59.266Z (6 months ago)
- Topics: plugin, spotify, tmux
- Language: Shell
- Homepage:
- Size: 766 KB
- Stars: 23
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-tmux - tmux-spotify-playlists
README
# Spotify Tmux Plugin
Control Spotify directly from your tmux session. Compatible with macOS.
![add playlist demo](./assets/demo.gif)
## Features
* Control basic Spotify functions like play, pause, next, and previous.
* Toggle shuffle and repeat modes.
* Bind Spotify playlists/albums/tracks to specific keys (1-9) for quick access.
* Display currently playing track, artist, album, and playback state in the tmux status bar.
* Configure your own keybindings.## Installation with Tmux Plugin Manager (TPM)
1. Add the plugin to your tmux.conf:
```bash
set -g @plugin 'danjeltahko/spotify-tmux'
```
2. Press prefix + I to install the plugin.## Usage
Once installed, you can use the key bindings to control Spotify. By default, the Spotify prefix is set to prefix + S.
Press the Spotify prefix followed by the configured keybinding:
| Key | Action |
|-----|----------------------------|
| o | Open Spotify |
| s | Toggle shuffle |
| r | Toggle repeat |
| p | Play/Pause |
| l | Next track |
| h | Previous track |
| a | Add a playlist |
| 1-9 | Play playlists 1 through 9 |
| ? | Show your saved playlists |> **Caution: When adding a new playlist/album with spotifyprefix+a, do not use : in the naming.** *The playlist file separates the ID, name and Spotify link using :. So using : in the name will result in playback issues. Instead, please use - for example.*
## Configuration
You can customize keybindings and other settings by setting tmux options in your tmux.conf:
```bash
set -g @spotify-open "o"
set -g @spotify-shuffle "s"
set -g @spotify-open "o"
set -g @spotify-shuffle "s"
set -g @spotify-repeat "r"
set -g @spotify-playpause "p"
set -g @spotify-next "l"
set -g @spotify-prev "h"
set -g @spotify-add-playlist "a"
set -g @spotify-show-playlists "?"
```
For example, to change the key binding to prefix + Shift + J, you'd add:```bash
set -g @spotifyprefix "J"
```### Status Bar Options
The following options can be interpolated in `status-right` or `status-left`:
- `#{spotify_track}`: Displays the currently playing track.
- `#{spotify_artist}`: Displays the currently playing artist.
- `#{spotify_album}`: Displays the currently playing album.
- `#{spotify_state}`: Displays the Spotify state (shuffle, repeat).Example:
```bash
set -g status-right "#{spotify_track} | #{spotify_artist} | #{spotify_album} | #{spotify_state}"
```You can also customize the icons that represent each state by setting tmux options in tmux.conf.
```bash
set -g @spotify-shuffle-icon "†"
set -g @spotify-playing-icon ""
set -g @spotify-repeat-icon "Ω"
```## Requirements
* macOS with the Spotify application installed.
* AppleScript support (osascript command available).
* In order to have the icons displayed correctly please use / update your favorite [nerd font](https://www.nerdfonts.com/font-downloads).