Spotify Player for VS Code
Control Spotify directly from Visual Studio Code without leaving your editor. Play, pause, skip tracks, and manage your music seamlessly while you code.
Features
- 🎵 Play/Pause Control - Toggle playback with a single command
- ⏭️ Next Track - Skip to the next song
- ⏮️ Previous Track - Go back to the previous song
- ⏹️ Stop Playback - Stop the music
- ❤️ Add to Favorites - Like the current track
- 📊 Status Bar Integration - See current track info in your status bar
- 🎹 Keyboard Shortcuts - Control music without touching your mouse
- ℹ️ Track Information - View detailed info about the current track
Installation
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Search for "Spotify Player for Linux"
- Click Install
Requirements
- Linux operating system (uses D-Bus/MPRIS)
- Spotify Desktop Application installed and running
- Optional:
xdotool and playerctl for enhanced functionality
Install System Dependencies
Ubuntu/Debian:
sudo apt-get install dbus xdotool playerctl
Fedora/RHEL:
sudo dnf install dbus xdotool playerctl
Arch Linux:
sudo pacman -S dbus xdotool playerctl
Usage
Commands
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and type "Spotify":
- Spotify: Play/Pause - Toggle playback
- Spotify: Play - Start playing
- Spotify: Pause - Pause playback
- Spotify: Next Track - Skip to next song
- Spotify: Previous Track - Go to previous song
- Spotify: Stop - Stop playback
- Spotify: Add to Favorites - Like current track
- Spotify: Show Current Track Info - Display track details
- Spotify: Open Application - Launch Spotify
Keyboard Shortcuts
| Command |
Windows/Linux |
macOS |
| Play/Pause |
Ctrl+Alt+Space |
Cmd+Alt+Space |
| Next Track |
Ctrl+Alt+Right |
Cmd+Alt+Right |
| Previous Track |
Ctrl+Alt+Left |
Cmd+Alt+Left |
| Add to Favorites |
Ctrl+Alt+L |
Cmd+Alt+L |
Status Bar
The status bar shows:
- Current playback status (playing/paused)
- Track name and artist
- Click to play/pause
Configuration
Access settings via File > Preferences > Settings and search for "Spotify Play":
spotifyPlay.updateInterval - Status bar update interval in milliseconds (default: 3000)
spotifyPlay.showStatusBar - Show/hide status bar item (default: true)
How It Works
This extension uses the MPRIS D-Bus interface to communicate with Spotify on Linux. MPRIS (Media Player Remote Interfacing Specification) is a standard D-Bus interface for controlling media players.
Troubleshooting
Spotify is not running error
Make sure Spotify desktop application is running before using the extension commands.
Commands not working
- Verify Spotify is installed:
which spotify
- Check if Spotify is running:
ps aux | grep spotify
- Test D-Bus connection:
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2.Player string:PlaybackStatus
Add to Favorites not working
The "Add to Favorites" feature requires xdotool and playerctl:
sudo apt-get install xdotool playerctl
Alternatively, use Spotify's native shortcut: Ctrl+Alt+B
Support & Feedback
Found a bug or have a feature request? Please open an issue on the GitHub repository.
License
MIT License
Enjoy coding with your favorite music! 🎶