Skip to content

Instantly share code, notes, and snippets.

View PSandro's full-sized avatar
:shipit:
Working from home

Sandro PSandro

:shipit:
Working from home
View GitHub Profile
@PSandro
PSandro / spotify-volume
Created January 25, 2021 17:55
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