Skip to content

Instantly share code, notes, and snippets.

@PSandro
Created January 25, 2021 17:55
Show Gist options
  • Save PSandro/3f1ec4922f4135669409f40b6e1ad87f to your computer and use it in GitHub Desktop.
Save PSandro/3f1ec4922f4135669409f40b6e1ad87f to your computer and use it in GitHub Desktop.
change spotify's volume on Linux via pulseaudio
#!/bin/bash
## usage: spotify-volume "50%"
## sets the spotify volume to 50%
SINKID=$(pacmd list-sink-inputs | tr '\n' '\r' | perl -pe 's/ *index: ([0-9]+).+?application\.process\.binary = "spotify"\r.+/\1\r/g' | tr '\r' '\n' | tail -1)
pactl set-sink-input-volume $SINKID $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment