Skip to content

Instantly share code, notes, and snippets.

@yolabingo
Created December 4, 2017 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yolabingo/3c0b286ba7f6b85b518d4d052e91c9fb to your computer and use it in GitHub Desktop.
Save yolabingo/3c0b286ba7f6b85b518d4d052e91c9fb to your computer and use it in GitHub Desktop.
#!/bin/bash
scriptname=$(basename "$0")
for index in $(pacmd list-sink-inputs | egrep -i -B 25 "seamonkey|chrome|firefox" | grep index: | awk '{print $2}')
do
volume=$(pacmd list-sink-inputs | grep -A 8 "index: ${index}" | grep volume: | awk '{print $3}')
if [ $scriptname == "volume-up" ]
then
echo "volume up"
(( volume=volume+5000 ))
fi
if [ $scriptname == "volume-down" ]
then
echo "volume down"
(( volume=volume-5000 ))
fi
pacmd set-sink-input-volume $index $volume
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment