Created
January 25, 2021 17:55
-
-
Save PSandro/3f1ec4922f4135669409f40b6e1ad87f to your computer and use it in GitHub Desktop.
change spotify's volume on Linux via pulseaudio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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