Thanks to visit codestin.com
Credit goes to github.com

Skip to content

๐ŸŽต Turn your keyboard into a full-featured Spotify controller. Spotify MacroPad is a Python script that lets you control Spotify playback using custom keyboard shortcuts โ€” no need for expensive stream decks. Toggle play/pause, skip tracks, adjust volume, like songs, shuffle, repeat, and more โ€” all from your keyboard.

License

Notifications You must be signed in to change notification settings

naarvent/Spotify_MacroPad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽง Spotify MacroPad

A Python script that lets you control Spotify using keyboard shortcuts.
It allows you to play/pause, skip tracks, adjust volume, toggle shuffle or repeat, like songs, mute/unmute โ€” all without leaving your current app.

There are two versions:

  • ๐Ÿ‡ช๐Ÿ‡ธ spotify_macropad.py โ†’ for Spanish keyboard layout.
  • ๐Ÿ‡ฌ๐Ÿ‡ง spotify_macropad_en.py โ†’ for English keyboard layout.

๐Ÿง  What It Does

Spotify MacroPad turns your keyboard into a control panel for Spotify.
When active, it listens for specific keys and sends commands to Spotify via the official Spotify Web API (using Spotipy).

Main features:

  • โ–ถ๏ธ Play / Pause
  • โญ๏ธ Next track
  • โฎ๏ธ Previous track (or restart if within 3 seconds)
  • ๐Ÿ”Š Volume up / down
  • ๐Ÿ” Cycle repeat mode
  • ๐Ÿ”€ Toggle shuffle
  • โค๏ธ Like / Unlike current song
  • ๐Ÿ”‡ Mute / Unmute
  • ๐Ÿ”˜ Toggle active state (enable/disable script)

โš™๏ธ Installation

  1. Clone the repository or download the files:

      git clone https://github.com/yourusername/spotify-macropad.git
      cd spotify-macropad
    
  2. Install dependencies:

      pip install spotipy keyboard
    
  3. Create an app on the Spotify Developer Dashboard

  4. Edit the configuration:

    Open spotify_macropad.py (or the English version) and replace:

      CLIENT_ID = "YOUR_CLIENT_ID"
      CLIENT_SECRET = "YOUR_CLIENT_SECRET"
      REDIRECT_URI = "YOUR_REDIRECT_URI"
    
  5. Run the script:

      python spotify_macropad.py
    

    The first time you run it, a browser window will open asking for Spotify authorization.


๐ŸŽน Default Keybindings

๐Ÿ‡ช๐Ÿ‡ธ Spanish Version (spotify_macropad.py)

Key Action
Re Pag Toggle active state
Av Pag Play / Pause
โ†‘ / โ†“ Volume up / down
โ† / โ†’ Previous / Next track
Supr Toggle shuffle
Right Shift Change repeat mode
Inicio Like / Unlike current track
ร‡ Mute / Unmute

๐Ÿ‡ฌ๐Ÿ‡ง English Version (spotify_macropad_en.py)

Key Action
Page Up Toggle active state
Page Down Play / Pause
โ†‘ / โ†“ Volume up / down
โ† / โ†’ Previous / Next track
Delete Toggle shuffle
Right Shift Change repeat mode
Home Like / Unlike current track
Right Ctrl Mute / Unmute

๐Ÿ’พ File Structure

By default, the script creates the following directory in your user folder:

  Documents/naarventโ€™s projects/SpotifyMacroPad/
  โ”œโ”€โ”€ .spotify_oauth_cache     (authentication data)
  โ””โ”€โ”€ track_history.txt        (track history)

๐Ÿงฉ Technical Details

  • Built with Python 3.10+
  • Requires Spotify Premium (for playback control via API)
  • Uses keyboard for global key detection
  • Logs playback history automatically
  • Includes fallback logic when playback is inactive

About

๐ŸŽต Turn your keyboard into a full-featured Spotify controller. Spotify MacroPad is a Python script that lets you control Spotify playback using custom keyboard shortcuts โ€” no need for expensive stream decks. Toggle play/pause, skip tracks, adjust volume, like songs, shuffle, repeat, and more โ€” all from your keyboard.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published